summaryrefslogtreecommitdiff
path: root/tests/threads/test_create_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/threads/test_create_join.c')
-rw-r--r--tests/threads/test_create_join.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/threads/test_create_join.c b/tests/threads/test_create_join.c
index 12b39d3..0eaa6a6 100644
--- a/tests/threads/test_create_join.c
+++ b/tests/threads/test_create_join.c
@@ -25,14 +25,19 @@
#define NOF_ITERATIONS 10000
static WOLF_THREAD_RETURN_DECL thread_func( void *thread_data ) {
+ int thread_id = *((int *)thread_data);
int i;
+ printf( "Starting thread %d\n", thread_id );
+ fflush( stdout );
+
for( i = 0; i < NOF_ITERATIONS; i++ ) {
printf( "%d\n", i );
fflush( stdout );
}
- WOLF_UNUSED( thread_data );
+ printf( "Terminating thread %d\n", thread_id );
+ fflush( stdout );
WOLF_THREAD_RETURN
}
@@ -41,9 +46,11 @@ int main( void ) {
int i;
wolf_thread_t thread[NOF_THREADS];
wolf_error_t error;
+ int thread_data[NOF_THREADS];
for( i = 0; i < NOF_THREADS; i++ ) {
- error = wolf_thread_create( &thread[i], thread_func );
+ thread_data[i] = i;
+ error = wolf_thread_create( &thread[i], thread_func, (void *)&thread_data[i] );
if( error != WOLF_OK ) {
fprintf( stderr, "Unable to start thread %d: %d\n", i, error );
return EXIT_FAILURE;