#include <threads.h>
#include <sched.h>
#include <bits/pthreadtypes.h>
+#include <pthread.h>
+/* Mutex types. */
enum
{
PTHREAD_MUTEX_TIMED_NP,
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 {
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**);
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 *);
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);
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