Sun May 6 17:05:00 2001 Robert Collins <rbtcollins@hotmail.com>

* thread.h (pthread_cond): New element cond_access to allow atomic broadcasts.
	* thread.cc (pthread_cond::pthread_cond): Initialise cond_access.
	(pthread_cond::~pthread_cond): Destroy cond_access.
	(pthread_cond::Broadcast): Use cond_access.
	(pthread_cond::Signal): Use cond_access.
	(pthread_cond_wait): Use cond_access.
	(pthread_cond_timedwait): Use cond_access.
This commit is contained in:
Robert Collins
2001-05-06 22:23:43 +00:00
parent 2bfb966544
commit 68ebd3f6e2
3 changed files with 69 additions and 10 deletions

View File

@@ -290,6 +290,8 @@ public:
int shared;
LONG waiting;
pthread_mutex *mutex;
/* to allow atomic behaviour for cond_broadcast */
pthread_mutex_t cond_access;
HANDLE win32_obj_id;
int TimedWait (DWORD dwMilliseconds);
void BroadCast ();