7 #define CHUNK_SIZE 16000 /* same as findcmd.c's */
8 #define BUF_SIZE (2 * CHUNK_SIZE) /* at least two chunks */
11 int8_t int8_search_buf
[100];
12 int16_t int16_search_buf
[100];
13 int32_t int32_search_buf
[100];
14 int64_t int64_search_buf
[100];
16 static char *search_buf
;
17 static int search_buf_size
;
19 int8_t int8_global
= 42;
23 /* We use a `char[]' type below rather than the typical `char *'
24 to make sure that `str' gets allocated on the stack. Otherwise,
25 the compiler may place the "hello, testsuite" string inside
26 a read-only section, preventing us from over-writing it from GDB. */
27 char str
[] = "hello, testsuite";
29 puts (str
); /* Break here. */
42 search_buf_size
= BUF_SIZE
;
43 search_buf
= malloc (search_buf_size
);
44 if (search_buf
== NULL
)
46 memset (search_buf
, 'x', search_buf_size
);
52 pthread_barrier_t
*barrier
= (pthread_barrier_t
*) param
;
54 pthread_barrier_wait (barrier
);
60 check_threads (pthread_barrier_t
*barrier
)
62 pthread_barrier_wait (barrier
);
68 pthread_t threads
[NUMTH
];
69 pthread_barrier_t barrier
;
72 pthread_barrier_init (&barrier
, NULL
, NUMTH
+ 1);
74 for (i
= 0; i
< NUMTH
; ++i
)
75 pthread_create (&threads
[i
], NULL
, thread
, &barrier
);
77 check_threads (&barrier
);
79 for (i
= 0; i
< NUMTH
; ++i
)
80 pthread_join (threads
[i
], NULL
);
82 pthread_barrier_destroy (&barrier
);
87 int main (int argc
, char *argv
[])