change the namespace of mutex from std to cdsc
[c11tester.git] / include / pthread.h
index 92b1d1b8127c9554df1b151596dc1ef7b16f139d..8e0a6908063c35c4025002a6fe63f503fbe5d132 100644 (file)
@@ -8,7 +8,9 @@
 #include <threads.h>
 #include <sched.h>
 #include <bits/pthreadtypes.h>
+#include <pthread.h>
 
+/* Mutex types.  */
 enum
 {
   PTHREAD_MUTEX_TIMED_NP,
@@ -23,12 +25,11 @@ enum
   PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
 #endif
 #ifdef __USE_GNU
-  /* For compatibility.  */
+  /* For compatibility.  */ 
   , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
 #endif
 };
 
-
 typedef void *(*pthread_start_t)(void *);
 
 struct pthread_params {
@@ -36,15 +37,28 @@ struct pthread_params {
     void *arg;
 };
 
+extern "C" {
 int pthread_create(pthread_t *, const pthread_attr_t *,
           void *(*start_routine) (void *), void * arg);
 void pthread_exit(void *);
 int pthread_join(pthread_t, void **);
 
+pthread_t pthread_self(void);
+
 int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *);
 int pthread_mutex_lock(pthread_mutex_t *);
 int pthread_mutex_trylock(pthread_mutex_t *);
 int pthread_mutex_unlock(pthread_mutex_t *);
+int pthread_mutex_timedlock (pthread_mutex_t *__restrict p_mutex,
+                               const struct timespec *__restrict __abstime);
+
+int pthread_cond_init(pthread_cond_t *p_cond, const pthread_condattr_t *attr);
+int pthread_cond_wait(pthread_cond_t *p_cond, pthread_mutex_t *p_mutex);
+int pthread_cond_timedwait(pthread_cond_t *p_cond, 
+    pthread_mutex_t *p_mutex, const struct timespec *abstime);
+int pthread_cond_signal(pthread_cond_t *);
+
+void pthread_cleanup_push(void (*routine)(void*), void *arg );
 
 int user_main(int, char**);
 
@@ -73,11 +87,6 @@ int pthread_attr_setstacksize(pthread_attr_t *, size_t);
 int pthread_cancel(pthread_t);
 int pthread_cond_broadcast(pthread_cond_t *);
 int pthread_cond_destroy(pthread_cond_t *);
-int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
-int pthread_cond_signal(pthread_cond_t *);
-int pthread_cond_timedwait(pthread_cond_t *, 
-          pthread_mutex_t *, const struct timespec *);
-int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *);
 int pthread_condattr_destroy(pthread_condattr_t *);
 int pthread_condattr_getpshared(const pthread_condattr_t *, int *);
 int pthread_condattr_init(pthread_condattr_t *);
@@ -118,8 +127,6 @@ int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *,
           int *);
 int pthread_rwlockattr_init(pthread_rwlockattr_t *);
 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
-pthread_t
-      pthread_self(void);
 int pthread_setcancelstate(int, int *);
 int pthread_setcanceltype(int, int *);
 int pthread_setconcurrency(int);
@@ -128,9 +135,7 @@ int pthread_setschedparam(pthread_t, int ,
 int pthread_setspecific(pthread_key_t, const void *);
 void pthread_testcancel(void);
 
-int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
-                                    const struct timespec *__restrict
-                                    __abstime) __THROWNL __nonnull ((1, 2));
+}
 
 void check();
 #endif