Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1265 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

different values PTHREAD_CREATE_JOINABLE and other on darwin from linux

Reported by: fawzi Assigned to: sean
Priority: major Milestone: 0.99.8
Component: Core Functionality Version: 0.99.7 Dominik
Keywords: Cc:

Description

the switch to enum has lost the "auto config", and some constants have a different value than the enum value.

maybe keeping the extern(C) (at least as version) would be a good idea.

Anyway here are the correct values for darwin

--- tango/stdc/posix/pthread.d  (revision 3906)
+++ tango/stdc/posix/pthread.d  (working copy)
@@ -83,7 +83,45 @@
 int pthread_setspecific(pthread_key_t, void*);
 void pthread_testcancel();
 */
+version(darwin){
+    enum
+    {
+        PTHREAD_CANCEL_ENABLE=0x01,
+        PTHREAD_CANCEL_DISABLE=0x00
+    }
 
+    enum
+    {
+        PTHREAD_CANCEL_DEFERRED=0x02,
+        PTHREAD_CANCEL_ASYNCHRONOUS=0x00
+    }
+
+    const PTHREAD_CANCELED = cast(void*) -1;
+
+    //const pthread_mutex_t PTHREAD_COND_INITIALIZER = { __LOCK_ALT_INITIALIZER, 0, "", 0 };
+
+    enum
+    {
+        PTHREAD_CREATE_JOINABLE=1,
+        PTHREAD_CREATE_DETACHED
+    }
+
+    enum
+    {
+        PTHREAD_INHERIT_SCHED=1,
+        PTHREAD_EXPLICIT_SCHED
+    }
+
+    //const pthread_mutex_t PTHREAD_MUTEX_INITIALIZER = { 0, 0, null, PTHREAD_MUTEX_NORMAL, { 0, 0 } };
+
+    const PTHREAD_ONCE_INIT = 0;
+
+    enum
+    {
+        PTHREAD_PROCESS_PRIVATE=2,
+        PTHREAD_PROCESS_SHARED=1
+    }
+} else {
 enum
 {
     PTHREAD_CANCEL_ENABLE,
@@ -121,6 +159,7 @@
     PTHREAD_PROCESS_PRIVATE,
     PTHREAD_PROCESS_SHARED
 }
+}
 
 int pthread_atfork(void function(), void function(), void function());
 int pthread_attr_destroy(pthread_attr_t*);

Change History

09/08/08 16:42:20 changed by sean

  • status changed from new to closed.
  • resolution set to fixed.

(In [3930]) Applied changes per #1265. This closes #1265