* fhandler_tape.cc (fhandler_dev_tape::_lock): Add cw_sig_restart to

cygwait call.
	* thread.cc (pthread_mutex::lock): Ditto.
	(semaphore::_timedwait): Fix formatting.
	(semaphore::_wait): Ditto.
	* thread.h (fast_mutex::lock): Ditto.

	...and fix ChangeLog accordingly.
This commit is contained in:
Corinna Vinschen 2015-02-25 17:50:13 +00:00
parent e93954138f
commit 0066e440c1
4 changed files with 19 additions and 15 deletions

View File

@ -1,3 +1,12 @@
2015-02-25 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tape.cc (fhandler_dev_tape::_lock): Add cw_sig_restart to
cygwait call.
* thread.cc (pthread_mutex::lock): Ditto.
(semaphore::_timedwait): Fix formatting.
(semaphore::_wait): Ditto.
* thread.h (fast_mutex::lock): Ditto.
2015-02-25 Corinna Vinschen <corinna@vinschen.de> 2015-02-25 Corinna Vinschen <corinna@vinschen.de>
* security.cc (alloc_sd): Don't apply temporary workaround for chmod * security.cc (alloc_sd): Don't apply temporary workaround for chmod
@ -8,13 +17,6 @@
* fhandler_tty.cc (fhandler_pty_slave::read): Having no input is not an * fhandler_tty.cc (fhandler_pty_slave::read): Having no input is not an
error condition for tcflush. error condition for tcflush.
2015-02-25 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tape.cc (fhandler_dev_tape::_lock): Add cw_sig_restart to
cygwait call.
* thread.cc (pthread_mutex::lock): Ditto.
* thread.h (fast_mutex::lock): Ditto.
2015-02-25 Corinna Vinschen <corinna@vinschen.de> 2015-02-25 Corinna Vinschen <corinna@vinschen.de>
* security.cc (alloc_sd): Fix comment style. Remove code unused for * security.cc (alloc_sd): Fix comment style. Remove code unused for

View File

@ -2,7 +2,7 @@
classes. classes.
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011, 2012, 2013, 2014 Red Hat, Inc. 2010, 2011, 2012, 2013, 2014, 2015 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -1160,7 +1160,8 @@ fhandler_dev_tape::_lock (bool cancelable)
/* O_NONBLOCK is only valid in a read or write call. Only those are /* O_NONBLOCK is only valid in a read or write call. Only those are
cancelable. */ cancelable. */
DWORD timeout = cancelable && is_nonblocking () ? 0 : INFINITE; DWORD timeout = cancelable && is_nonblocking () ? 0 : INFINITE;
switch (cygwait (mt_mtx, timeout, cw_sig | cw_cancel | cw_cancel_self)) switch (cygwait (mt_mtx, timeout,
cw_sig | cw_sig_restart | cw_cancel | cw_cancel_self))
{ {
case WAIT_OBJECT_0: case WAIT_OBJECT_0:
return true; return true;

View File

@ -1760,8 +1760,7 @@ pthread_mutex::lock ()
else if (type == PTHREAD_MUTEX_NORMAL /* potentially causes deadlock */ else if (type == PTHREAD_MUTEX_NORMAL /* potentially causes deadlock */
|| !pthread::equal (owner, self)) || !pthread::equal (owner, self))
{ {
/* FIXME: no cancel? */ cygwait (win32_obj_id, cw_infinite, cw_sig | cw_sig_restart);
cygwait (win32_obj_id, cw_infinite, cw_sig);
set_owner (self); set_owner (self);
} }
else else
@ -3518,7 +3517,8 @@ semaphore::_timedwait (const struct timespec *abstime)
timeout.QuadPart = abstime->tv_sec * NSPERSEC timeout.QuadPart = abstime->tv_sec * NSPERSEC
+ (abstime->tv_nsec + 99) / 100 + FACTOR; + (abstime->tv_nsec + 99) / 100 + FACTOR;
switch (cygwait (win32_obj_id, &timeout, cw_cancel | cw_cancel_self | cw_sig_eintr)) switch (cygwait (win32_obj_id, &timeout,
cw_cancel | cw_cancel_self | cw_sig_eintr))
{ {
case WAIT_OBJECT_0: case WAIT_OBJECT_0:
break; break;
@ -3551,7 +3551,8 @@ semaphore::_timedwait (const struct timespec *abstime)
int int
semaphore::_wait () semaphore::_wait ()
{ {
switch (cygwait (win32_obj_id, cw_infinite, cw_cancel | cw_cancel_self | cw_sig_eintr)) switch (cygwait (win32_obj_id, cw_infinite,
cw_cancel | cw_cancel_self | cw_sig_eintr))
{ {
case WAIT_OBJECT_0: case WAIT_OBJECT_0:
break; break;

View File

@ -1,7 +1,7 @@
/* thread.h: Locking and threading module definitions /* thread.h: Locking and threading module definitions
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
2010, 2011, 2012, 2013 Red Hat, Inc. 2010, 2011, 2012, 2013, 2014, 2015 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -60,7 +60,7 @@ public:
void lock () void lock ()
{ {
if (InterlockedIncrement (&lock_counter) != 1) if (InterlockedIncrement (&lock_counter) != 1)
cygwait (win32_obj_id, cw_infinite, cw_sig); cygwait (win32_obj_id, cw_infinite, cw_sig | cw_sig_restart);
} }
void unlock () void unlock ()