Added support for another pthread related function
authorKevin Klues <klueska@ros-dev.(none)>
Tue, 6 Apr 2010 03:57:11 +0000 (20:57 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:41 +0000 (17:35 -0700)
This function is needed to compile fluidanimate, but
is currently meaningless in our current implementation of
pthreads.

user/include/pthread.h
user/parlib/pthread.c

index f369049..157d5f7 100644 (file)
@@ -7,6 +7,15 @@
   extern "C" {
 #endif
 
+/* Detach state.  */
+enum
+{
+  PTHREAD_CREATE_JOINABLE,
+#define PTHREAD_CREATE_JOINABLE        PTHREAD_CREATE_JOINABLE
+  PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED        PTHREAD_CREATE_DETACHED
+};
+
 struct pthread_wqt
 {
   void* (*start_routine)(void*);
@@ -68,6 +77,8 @@ int pthread_create(pthread_t *, const pthread_attr_t *,
                    void *(*)(void *), void *);
 int pthread_join(pthread_t, void **);
 
+int pthread_attr_setdetachstate(pthread_attr_t *__attr,int __detachstate);
+
 int pthread_mutex_destroy(pthread_mutex_t *);
 int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *);
 int pthread_mutex_lock(pthread_mutex_t *);
index bda3ab3..f3ffeae 100644 (file)
@@ -112,6 +112,12 @@ int pthread_mutexattr_destroy(pthread_mutexattr_t* attr)
   return 0;
 }
 
+
+int pthread_attr_setdetachstate(pthread_attr_t *__attr,int __detachstate) {
+       *__attr = __detachstate;
+       return 0;
+}
+
 int pthread_mutexattr_gettype(const pthread_mutexattr_t* attr, int* type)
 {
   *type = attr ? attr->type : PTHREAD_MUTEX_DEFAULT;