]> git.sur5r.net Git - openldap/blobdiff - include/lthread.h
Added support for password prompting. (-W switch)
[openldap] / include / lthread.h
index 2a23c7791fdebb36fd5c58731c38ad5753cd8f65..3485406d93652ba0626294d9a6ee8211eef6200f 100644 (file)
@@ -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 <windows.h>
+#include <process.h>
+
+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 */