From 4896eb26a6c8fc24e8d12a180f3a10027abb4127 Mon Sep 17 00:00:00 2001 From: rpj Date: Sun, 12 Jul 1998 15:55:40 +0000 Subject: See the ChangeLog. --- ChangeLog | 8 ++++++++ create.c | 12 +++++------- implement.h | 10 +++++++--- mutex.c | 1 + pthread.h | 8 +------- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d7801a..01a9559 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Jul 13 01:09:55 1998 Ross Johnson + + * implement.h: Wrap in #ifndef _IMPLEMENT_H + + * create.c (pthread_create): Map stacksize attr to Win32. + + * mutex.c: Include implement.h + 1998-07-13 Ben Elliston * condvar.c (pthread_condattr_init): Implement. diff --git a/create.c b/create.c index daae84f..7a374bb 100644 --- a/create.c +++ b/create.c @@ -20,13 +20,8 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr, Map attributes as correctly as possible. */ HANDLE handle; - - /* FIXME: I don't have doco on attributes so these aren't - included yet. Threads will be started with Win32 defaults: - unsuspended and with default stack size. - */ - DWORD flags = 0; - DWORD stack = 0; + DWORD flags = 0; /* Always 0 for POSIX threads */ + DWORD stack = PTHREAD_STACK_MIN; LPSECURITY_ATTRIBUTES security = NULL; /* FIXME: This needs to be moved into process space. @@ -48,6 +43,8 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr, break; default: /* Map attributes */ + if (attr->stacksize != NULL) + stack = (DWORD) attr->stacksize; break; } @@ -65,3 +62,4 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr, pthread_threads_count++; return 0; } + diff --git a/implement.h b/implement.h index 1df2e11..2e8cbca 100644 --- a/implement.h +++ b/implement.h @@ -1,14 +1,16 @@ /* * implement.h * - * Things that do not belong in pthread.h but may be needed - * by other parts of this pthreads implementation internally. + * Implementation specific (non API) stuff. */ +#ifndef _IMPLEMENT_H +#define _IMPLEMENT_H + /* FIXME: Arbitrary. Need values from Win32. */ #define PTHREAD_THREADS_MAX 256 -#define PTHREAD_STACK_MIN 65535 +#define PTHREAD_STACK_MIN 65535 extern DWORD pthreads_thread_count; @@ -23,3 +25,5 @@ typedef struct { typedef struct { int pshared; } _pthread_condattr_t; + +#endif /* _IMPLEMENT_H */ diff --git a/mutex.c b/mutex.c index 0df939b..f4fb4f9 100644 --- a/mutex.c +++ b/mutex.c @@ -6,6 +6,7 @@ */ #include "pthread.h" +#include "implement.h" static int insert_attr(pthread_mutexattr_t *attr) diff --git a/pthread.h b/pthread.h index 4d399f0..b408c76 100644 --- a/pthread.h +++ b/pthread.h @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* FIXME: do not include function prototypes for functions which are - not yet implemented. This will allows us to keep a better handle on + not yet implemented. This will allow us to keep a better handle on where we're at. */ #ifndef _PTHREADS_H @@ -106,9 +106,3 @@ int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr, #endif /* __cplusplus */ #endif /* _PTHREADS_H */ - - - - - - -- cgit v1.2.3