summaryrefslogtreecommitdiff
path: root/src/threads/threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/threads/threads.c')
-rw-r--r--src/threads/threads.c8
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: