X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Flthread.h;h=3485406d93652ba0626294d9a6ee8211eef6200f;hb=9697ad210a9e288c26dc3a62df87128ecc3a9f20;hp=2a23c7791fdebb36fd5c58731c38ad5753cd8f65;hpb=1c91859e9b02dba8724572dbaebb3533bc64d2c1;p=openldap diff --git a/include/lthread.h b/include/lthread.h index 2a23c7791f..3485406d93 100644 --- a/include/lthread.h +++ b/include/lthread.h @@ -119,8 +119,6 @@ typedef void *(*VFP)(); #define PTHREAD_SHARE_PRIVATE USYNC_THREAD #define PTHREAD_SHARE_PROCESS USYNC_PROCESS - -#if !defined(__SunOS_5_6) /* thread attributes and thread type */ typedef int pthread_attr_t; typedef thread_t pthread_t; @@ -132,7 +130,6 @@ typedef mutex_t pthread_mutex_t; /* condition variable attributes and condition variable type */ typedef int pthread_condattr_t; typedef cond_t pthread_cond_t; -#endif /* ! sunos56 */ LDAP_END_DECL @@ -185,6 +182,42 @@ typedef struct lwpcv { LDAP_END_DECL +#elif HAVE_NT_THREADS + +#include +#include + +typedef void (*VFP)(void*); + +/* thread attributes and thread type */ +typedef int pthread_attr_t; +typedef HANDLE pthread_t; + +/* default attr states */ +#define pthread_mutexattr_default NULL +#define pthread_condattr_default NULL + +/* thread state - joinable or not */ +#define PTHREAD_CREATE_JOINABLE 0 +#define PTHREAD_CREATE_DETACHED 0 +/* thread scope - who is in scheduling pool */ +#define PTHREAD_SCOPE_PROCESS 0 +#define PTHREAD_SCOPE_SYSTEM 0 + +/* mutex attributes and mutex type */ +typedef int pthread_mutexattr_t; +typedef HANDLE pthread_mutex_t; + +/* mutex and condition variable scope - process or system */ +#define PTHREAD_SHARE_PRIVATE USYNC_THREAD +#define PTHREAD_SHARE_PROCESS USYNC_PROCESS + +/* condition variable attributes and condition variable type */ +typedef int pthread_condattr_t; +typedef HANDLE pthread_cond_t; +typedef int any_t; + + #else /*********************************** @@ -200,11 +233,6 @@ LDAP_BEGIN_DECL #define NO_THREADS 1 #endif -#ifndef PREEMPTIVE_THREADS -/* treat no threads as preemptive */ -#define PREEMPTIVE_THREADS 1 -#endif - typedef void *(*VFP)(); /* thread attributes and thread type */