* fhandler_windows.cc (fhandler_windows::read): Use

pthread::get_cancel_event to fetch thread's cancel event.
	* flock.cc (lf_setlock): Ditto.
	* posix_ipc.cc (ipc_cond_timedwait): Ditto.
	* thread.cc (pthread::get_cancel_event): New static method.
	* thread.h (pthread::get_cancel_event): Declare.
This commit is contained in:
Corinna Vinschen
2011-05-01 17:42:41 +00:00
parent 1112b2c38f
commit a91ac4dca9
6 changed files with 28 additions and 13 deletions

View File

@@ -98,10 +98,8 @@ fhandler_windows::read (void *buf, size_t& len)
HANDLE w4[3] = { get_handle (), signal_arrived, NULL };
DWORD cnt = 2;
pthread_t thread = pthread::self ();
if (thread && thread->cancel_event
&& thread->cancelstate != PTHREAD_CANCEL_DISABLE)
w4[cnt++] = thread->cancel_event;
if ((w4[cnt] = pthread::get_cancel_event ()) != NULL)
++cnt;
restart:
switch (MsgWaitForMultipleObjectsEx (cnt, w4,
is_nonblocking () ? 0 : INFINITE,