diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2010-06-03 22:03:27 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2010-06-03 22:03:27 +0200 |
commit | 58f1c192c2aa58d959ecb69197b2650b27f2eb7d (patch) | |
tree | 99f7cad6c22626498a443fd0187e7bbf9e9b9ce0 /src | |
parent | d1825f38cf363be594af0e566ab91eb75e4c0376 (diff) | |
download | wolfbones-58f1c192c2aa58d959ecb69197b2650b27f2eb7d.tar.gz wolfbones-58f1c192c2aa58d959ecb69197b2650b27f2eb7d.tar.bz2 |
can pass thread data now (Linux), adapted tests
Diffstat (limited to 'src')
-rw-r--r-- | src/threads/threads.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 <assert.h> /* 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 <errno.h> /* 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: |