diff --git a/src/thread/thread.c b/src/thread/thread.c index 94387ff6..8d64b9d3 100644 --- a/src/thread/thread.c +++ b/src/thread/thread.c @@ -220,9 +220,8 @@ static void _catch_signals(void) } -long thread_create_c(char *name, void *(*start_routine)(void *), void *arg, int stacksize, int detached, int line, char *file) +long thread_create_c(char *name, void *(*start_routine)(void *), void *arg, int detached, int line, char *file) { - pthread_attr_t attr; int created; thread_t *thread; thread_start_t *start; @@ -244,17 +243,13 @@ long thread_create_c(char *name, void *(*start_routine)(void *), void *arg, int start->thread = thread; start->detached = detached; - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, stacksize); created = 0; - if (pthread_create(&thread->sys_thread, &attr, _start_routine, start) == 0) + if (pthread_create(&thread->sys_thread, NULL, _start_routine, start) == 0) created = 1; else LOG_ERROR("Could not create new thread"); - pthread_attr_destroy(&attr); - if (created == 0) { LOG_ERROR("System won't let me create more threads, giving up"); return -1; diff --git a/src/thread/thread.h b/src/thread/thread.h index 33cdbe94..a3522657 100644 --- a/src/thread/thread.h +++ b/src/thread/thread.h @@ -24,8 +24,6 @@ #include -#define THREAD_DEFAULT_STACKSIZE 8192 - typedef struct thread_tag { /* the local id for the thread, and it's name */ long thread_id; @@ -80,7 +78,7 @@ typedef struct rwlock_tag { pthread_rwlock_t sys_rwlock; } rwlock_t; -#define thread_create(n,w,x,y,z) thread_create_c(n,w,x,y,z,__LINE__,__FILE__) +#define thread_create(n,x,y,z) thread_create_c(n,x,y,z,__LINE__,__FILE__) #define thread_mutex_create(x) thread_mutex_create_c(x,__LINE__,__FILE__) #define thread_mutex_lock(x) thread_mutex_lock_c(x,__LINE__,__FILE__) #define thread_mutex_unlock(x) thread_mutex_unlock_c(x,__LINE__,__FILE__) @@ -106,7 +104,7 @@ void thread_initialize_with_log_id(int log_id); void thread_shutdown(void); /* creation, destruction, locking, unlocking, signalling and waiting */ -long thread_create_c(char *name, void *(*start_routine)(void *), void *arg, int stacksize, int detached, int line, char *file); +long thread_create_c(char *name, void *(*start_routine)(void *), void *arg, int detached, int line, char *file); void thread_mutex_create_c(mutex_t *mutex, int line, char *file); void thread_mutex_lock_c(mutex_t *mutex, int line, char *file); void thread_mutex_unlock_c(mutex_t *mutex, int line, char *file);