* select.cc (peek_pipe): REALLY only grab mutex when we actually got something

from the pipe.
This commit is contained in:
Christopher Faylor 2001-09-26 22:24:09 +00:00
parent c918cf9421
commit 5fe74396e9
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Wed Sep 26 16:02:35 2001 Christopher Faylor <cgf@cygnus.com>
* select.cc (peek_pipe): REALLY only grab mutex when we actually got
something from the pipe.
Tue Sep 25 21:25:00 2001 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (pthread_cond::BroadCast): Use address with verifyable_object_isvalid().

View File

@ -454,7 +454,8 @@ peek_pipe (select_record *s, int ignra, HANDLE guard_mutex = NULL)
select_printf ("%s, PeekNamedPipe failed, %E", fh->get_name ());
n = -1;
}
else if (guard_mutex && WaitForSingleObject (guard_mutex, 0) != WAIT_OBJECT_0)
else if (n && guard_mutex
&& WaitForSingleObject (guard_mutex, 0) != WAIT_OBJECT_0)
{
select_printf ("%s, couldn't get mutex %p, %E", fh->get_name (),
guard_mutex);