diff options
author | Christopher Faylor <me@cgf.cx> | 2002-09-29 23:56:57 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-09-29 23:56:57 +0000 |
commit | 881ffcb478ac6825664faf7bee6a50d49171d37d (patch) | |
tree | 610522c94d5703090803ae5a6b815b1181408b0f /winsup/cygwin/thread.cc | |
parent | eb208df05a7513b23ebcc031d772f7e8db7def50 (diff) | |
download | cygnal-881ffcb478ac6825664faf7bee6a50d49171d37d.tar.gz cygnal-881ffcb478ac6825664faf7bee6a50d49171d37d.tar.bz2 cygnal-881ffcb478ac6825664faf7bee6a50d49171d37d.zip |
GNUify slightly.
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r-- | winsup/cygwin/thread.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index ca992d3d2..413d6946b 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -187,7 +187,7 @@ MTinterface::Init (int forked) } concurrency = 0; - threadcount = 1; /*1 current thread when Init occurs.*/ + threadcount = 1; /* 1 current thread when Init occurs.*/ pthread::initMainThread (&mainthread, myself->hProcess); pthread_mutex::initMutex (); @@ -2110,7 +2110,7 @@ pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, struct timeb currSysTime; long waitlength; ftime (&currSysTime); - waitlength = (abstime->tv_sec - currSysTime.time) *1000; + waitlength = (abstime->tv_sec - currSysTime.time) * 1000; if (waitlength < 0) return ETIMEDOUT; return __pthread_cond_dowait (cond, mutex, waitlength); @@ -2217,14 +2217,13 @@ __pthread_equal (pthread_t *t1, pthread_t *t2) /*Mutexes */ -/*FIXME: there's a potential race with PTHREAD_MUTEX_INITALIZER: - *the mutex is not actually inited until the first use. - *So two threads trying to lock/trylock may collide. - *Solution: we need a global mutex on mutex creation, or possibly simply - *on all constructors that allow INITIALIZER macros. - *the lock should be very small: only around the init routine, not - *every test, or all mutex access will be synchronised. - */ +/* FIXME: there's a potential race with PTHREAD_MUTEX_INITALIZER: + the mutex is not actually inited until the first use. + So two threads trying to lock/trylock may collide. + Solution: we need a global mutex on mutex creation, or possibly simply + on all constructors that allow INITIALIZER macros. + the lock should be very small: only around the init routine, not + every test, or all mutex access will be synchronised. */ int pthread_mutex::init (pthread_mutex_t *mutex, |