aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/thread.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-02-24 11:33:15 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-02-24 11:33:15 +0000
commitc9a76075f591015ebd55fa831bc07067b79ef26c (patch)
tree07bcb2ae32b1f77b175a510e1acd5c988df1aa8c /winsup/cygwin/thread.h
parentffde6695dafe9b4c5c652f6c8b6624e844900448 (diff)
downloadnewlib-c9a76075f591015ebd55fa831bc07067b79ef26c.zip
newlib-c9a76075f591015ebd55fa831bc07067b79ef26c.tar.gz
newlib-c9a76075f591015ebd55fa831bc07067b79ef26c.tar.bz2
* thread.cc (pthread::cancelable_wait): Rearrange slightly.
Add do_sig_wait parameter. Wait for signal_arrived if set to true. Return WAIT_SIGNALED if signal arrived. (pthread_cond::wait): Accomodate change to pthread::cancelable_wait. (pthread::join): Ditto. (semaphore::_timedwait): Ditto. (semaphore::_wait): Ditto. Change to return int to allow status feedback. (semaphore::wait): Return return value from semaphore::_wait. * thread.h (WAIT_SIGNALED): New definition. (pthread::cancelable_wait): Change declaration. Define do_sig_wait as false by default to not interfere with existing calls accidentally. (semaphore::_wait): Declare int.
Diffstat (limited to 'winsup/cygwin/thread.h')
-rw-r--r--winsup/cygwin/thread.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index 7d68b5f..e5a0bcc 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -347,6 +347,7 @@ private:
};
#define WAIT_CANCELED (WAIT_OBJECT_0 + 1)
+#define WAIT_SIGNALED (WAIT_OBJECT_0 + 2)
class _cygtls;
class pthread: public verifyable_object
@@ -393,7 +394,7 @@ public:
virtual void testcancel ();
static void static_cancel_self ();
- static DWORD cancelable_wait (HANDLE object, DWORD timeout, const bool do_cancel = true);
+ static DWORD cancelable_wait (HANDLE object, DWORD timeout, const bool do_cancel = true, const bool do_sig_wait = false);
virtual int setcancelstate (int state, int *oldstate);
virtual int setcanceltype (int type, int *oldtype);
@@ -646,7 +647,7 @@ public:
}
private:
- void _wait ();
+ int _wait ();
void _post ();
int _getvalue (int *sval);
int _trywait ();