]> git.llucax.com Git - software/druntime.git/blobdiff - import/stdc/posix/pthread.d
Changed pthread_cleanup to properly account for platform differences. core.thread...
[software/druntime.git] / import / stdc / posix / pthread.d
index 2be0412a547b98bf5b5eec87ad6f0ca274befcd6..3b83ea0c50dea6e2a89bce0036eefee1080f919f 100644 (file)
@@ -384,6 +384,25 @@ else version( darwin )
     int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
     int pthread_setconcurrency(int);
 }
+else version( freebsd )
+{
+    enum
+    {
+        PTHREAD_MUTEX_ERRORCHECK    = 1,
+        PTHREAD_MUTEX_RECURSIVE     = 2,
+        PTHREAD_MUTEX_NORMAL        = 3,
+        PTHREAD_MUTEX_ADAPTIVE_NP   = 4,
+        PTHREAD_MUTEX_TYPE_MAX
+    }
+    const PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_ERRORCHECK;
+
+    int pthread_attr_getguardsize(in pthread_attr_t*, size_t*);
+    int pthread_attr_setguardsize(pthread_attr_t*, size_t);
+    int pthread_getconcurrency();
+    int pthread_mutexattr_gettype(pthread_mutexattr_t*, int*);
+    int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
+    int pthread_setconcurrency(int);
+}
 
 //
 // CPU Time (TCT)
@@ -489,6 +508,24 @@ else version( darwin )
     int pthread_setschedparam(pthread_t, int, in sched_param*);
     //int pthread_setschedprio(pthread_t, int);
 }
+else version( freebsd )
+{
+    enum
+    {
+        PTHREAD_SCOPE_PROCESS   = 0,
+        PTHREAD_SCOPE_SYSTEM    = 0x2
+    }
+
+    int pthread_attr_getinheritsched(in pthread_attr_t*, int*);
+    int pthread_attr_getschedpolicy(in pthread_attr_t*, int*);
+    int pthread_attr_getscope(in pthread_attr_t*, int*);
+    int pthread_attr_setinheritsched(pthread_attr_t*, int);
+    int pthread_attr_setschedpolicy(pthread_attr_t*, int);
+    int pthread_attr_setscope(in pthread_attr_t*, int);
+    int pthread_getschedparam(pthread_t, int*, sched_param*);
+    int pthread_setschedparam(pthread_t, int, sched_param*);
+    //int pthread_setschedprio(pthread_t, int);
+}
 
 //
 // Stack (TSA|TSS)
@@ -520,6 +557,15 @@ else version( darwin )
     int pthread_attr_setstackaddr(pthread_attr_t*, void*);
     int pthread_attr_setstacksize(pthread_attr_t*, size_t);
 }
+else version( freebsd )
+{
+    int pthread_attr_getstack(in pthread_attr_t*, void**, size_t*);
+    int pthread_attr_getstackaddr(in pthread_attr_t*, void**);
+    int pthread_attr_getstacksize(in pthread_attr_t*, size_t*);
+    int pthread_attr_setstack(pthread_attr_t*, void*, size_t);
+    int pthread_attr_setstackaddr(pthread_attr_t*, void*);
+    int pthread_attr_setstacksize(pthread_attr_t*, size_t);
+}
 
 //
 // Shared Synchronization (TSH)