aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/thread.h
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hotmail.com>2002-06-10 02:40:13 +0000
committerRobert Collins <rbtcollins@hotmail.com>2002-06-10 02:40:13 +0000
commit43c3c4e37cdd286b3b8c85265e7cf5ff70c6437a (patch)
treee6b4915ad90cf026014a0f30aae1ba8253449a0b /winsup/cygwin/thread.h
parentc2102631fc6e7e6315780dc217bfdbecd9608234 (diff)
downloadnewlib-43c3c4e37cdd286b3b8c85265e7cf5ff70c6437a.zip
newlib-43c3c4e37cdd286b3b8c85265e7cf5ff70c6437a.tar.gz
newlib-43c3c4e37cdd286b3b8c85265e7cf5ff70c6437a.tar.bz2
/tmp/cvs610a0a90.1
Diffstat (limited to 'winsup/cygwin/thread.h')
-rw-r--r--winsup/cygwin/thread.h64
1 files changed, 33 insertions, 31 deletions
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index 25f20b4..6c28abc 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -229,6 +229,34 @@ public:
~pthread_attr ();
};
+class pthread_mutexattr:public verifyable_object
+{
+public:
+ int pshared;
+ int mutextype;
+ pthread_mutexattr ();
+ ~pthread_mutexattr ();
+};
+
+class pthread_mutex:public verifyable_object
+{
+public:
+ CRITICAL_SECTION criticalsection;
+ HANDLE win32_obj_id;
+ LONG condwaits;
+ int pshared;
+ class pthread_mutex * next;
+
+ int Lock ();
+ int TryLock ();
+ int UnLock ();
+ void fixup_after_fork ();
+
+ pthread_mutex (pthread_mutexattr * = NULL);
+ pthread_mutex (pthread_mutex_t *, pthread_mutexattr *);
+ ~pthread_mutex ();
+};
+
class pthread:public verifyable_object
{
public:
@@ -264,44 +292,20 @@ public:
void pop_cleanup_handler (int const execute);
static pthread* self ();
+ static void *thread_init_wrapper (void *);
private:
DWORD thread_id;
__pthread_cleanup_handler *cleanup_handlers;
+ pthread_mutex mutex;
friend void __pthread_exit (void *value_ptr);
+ friend int __pthread_join (pthread_t * thread, void **return_val);
+ friend int __pthread_detach (pthread_t * thread);
+
void pop_all_cleanup_handlers (void);
};
-class pthread_mutexattr:public verifyable_object
-{
-public:
- int pshared;
- int mutextype;
- pthread_mutexattr ();
- ~pthread_mutexattr ();
-};
-
-class pthread_mutex:public verifyable_object
-{
-public:
- CRITICAL_SECTION criticalsection;
- HANDLE win32_obj_id;
- LONG condwaits;
- int pshared;
- class pthread_mutex * next;
-
- int Lock ();
- int TryLock ();
- int UnLock ();
- void fixup_after_fork ();
-
- pthread_mutex (unsigned short);
- pthread_mutex (pthread_mutexattr *);
- pthread_mutex (pthread_mutex_t *, pthread_mutexattr *);
- ~pthread_mutex ();
-};
-
class pthread_condattr:public verifyable_object
{
public:
@@ -410,8 +414,6 @@ int __pthread_detach (pthread_t * thread);
extern "C"
{
-void *thread_init_wrapper (void *);
-
/* ThreadCreation */
int __pthread_create (pthread_t * thread, const pthread_attr_t * attr,
void *(*start_routine) (void *), void *arg);