From 58f1c192c2aa58d959ecb69197b2650b27f2eb7d Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 3 Jun 2010 22:03:27 +0200 Subject: can pass thread data now (Linux), adapted tests --- src/threads/threads.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/threads/threads.c b/src/threads/threads.c index 0c99697..1ff019d 100644 --- a/src/threads/threads.c +++ b/src/threads/threads.c @@ -23,7 +23,7 @@ #include /* for assertions */ #include "port/unused.h" -wolf_error_t wolf_thread_create( wolf_thread_t *thread, wolf_thread_func_t func ) { +wolf_error_t wolf_thread_create( wolf_thread_t *thread, wolf_thread_func_t func, void *data ) { pthread_attr_t attr; int res; @@ -36,7 +36,7 @@ wolf_error_t wolf_thread_create( wolf_thread_t *thread, wolf_thread_func_t func } /* create the thread */ - res = pthread_create( thread, &attr, func, NULL ); + res = pthread_create( thread, &attr, func, data ); if( res == EINVAL ) { return WOLF_ERR_INVALID_VALUE; } else if( res != 0 ) { @@ -68,13 +68,13 @@ wolf_error_t wolf_thread_join( wolf_thread_t *thread ) { #include /* for errno and EXXX values */ -wolf_error_t wolf_thread_create( wolf_thread_t *thread, wolf_thread_func_t func ) { +wolf_error_t wolf_thread_create( wolf_thread_t *thread, wolf_thread_func_t func, void *data ) { /* _beginthread doesn't signal termination. Unusable!, * CreateThread is for DLLs and surpasses CRT code, not good, * so we use _beginthreadex (this must be adapted if somebody * wants to write a DLL with these functions.. (see also POCO) */ - *thread = _beginthreadex( NULL, 0, func, NULL, 0, NULL ); + *thread = _beginthreadex( NULL, 0, func, data, 0, NULL ); if( thread < 0 ) { switch( errno ) { case EINVAL: -- cgit v1.2.3-54-g00ecf