From 9450ad0d02bb36c663d09a2fd486506de030ff08 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Sat, 21 Apr 2001 14:23:47 +0000 Subject: Sun Apr 22 20:22:00 2001 Robert Collins * passwd.cc (getpwuid): Check for thread cancellation. (getpwuid_r): Ditto. (getpwname): Ditto. (getpwnam_r): Ditto. * thread.h (pthread_mutex): New constructors for pshared operation. (MTinterface): Associative array for pshared mutex's. * thread.cc (MTinterface::Init): Initailize pshared mutex array. (pthread_cond::BroadCast): Implementation notes. (pthread_cond::TimedWait): Remove use of SignalObjectAndWait on non-NT systems. (pthread_mutex::pthread_mutex(unsigned short)): New function. (pthread_mutex::pthread_mutex (pthread_mutex_t *, pthread_mutexattr *)):New function. (pthread_mutex::pthread_mutex(pthread_mutexattr *)): Fail on pshared mutex's. (__pthread_mutex_getpshared): New function. (__pthread_join): Check for thread cancellation. (__pthread_cond_timedwait): Support pshared mutex's. (__pthread_cond_wait): Ditto. (__pthread_condattr_setpshared): Error on PROCESS_SHARED requests. (__pthread_mutex_init): Support pshared mutex's. (__pthread_mutex_getprioceiling): Ditto. (__pthread_mutex_lock): Ditto. (__pthread_mutex_trylock): Ditto. (__pthread_mutex_unlock): Ditto. (__pthread_mutex_destroy): Ditto. (__pthread_mutex_setprioceiling): Ditto. (__pthread_mutexattr_setpshared): Support PTHREAD_PROCESS_PSHARED requests. --- winsup/cygwin/thread.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/thread.h') diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index 6065f9d..39f0f58 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -263,12 +263,15 @@ class pthread_mutex:public verifyable_object public: HANDLE win32_obj_id; LONG condwaits; + int pshared; int Lock (); int TryLock (); int UnLock (); - + + pthread_mutex (unsigned short); pthread_mutex (pthread_mutexattr *); + pthread_mutex (pthread_mutex_t *, pthread_mutexattr *); ~pthread_mutex (); }; @@ -345,6 +348,11 @@ public: callback *pthread_child; callback *pthread_parent; + /* this is an associative array for the _exclusive_ use of pshared mutex's + * normal mutex's don't go here to reduce overhead and prevent serialisation. + */ + class pthread_mutex * pshared_mutexs[256]; + void Init (int); MTinterface ():reent_index (0), indexallocated (0), threadcount (1) -- cgit v1.1