Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Pfaff <tpfaff@gmx.net>2003-01-14 23:05:49 +0300
committerThomas Pfaff <tpfaff@gmx.net>2003-01-14 23:05:49 +0300
commit7ec66a2c28257d1dc25b08f457b9030bf4528d6f (patch)
tree21c48205462bd02a2771d50d7248931eb67e4549
parentd83b482409d4e776ed93ae813905fe90a7c17d10 (diff)
Apply sleep_cancel patch
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/signal.cc8
2 files changed, 13 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bc40e20a5..8ddb86120 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,4 +1,10 @@
-2003-01-10 Thomas Pfaff <tpfaff@gmx.net>
+2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
+
+ * signal.cc (sleep): Add pthread_testcancel call.
+ Wait for signal and cancellation event.
+ (usleep): Ditto.
+
+2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
* exceptions.cc (handle_sigsuspend): Add pthread_testcancel call.
Wait for signal and cancellation event.
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index a23487fc3..c85290712 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -74,12 +74,14 @@ sleep (unsigned int seconds)
sigframe thisframe (mainthread);
DWORD ms, start_time, end_time;
+ pthread_testcancel ();
+
ms = seconds * 1000;
start_time = GetTickCount ();
end_time = start_time + (seconds * 1000);
syscall_printf ("sleep (%d)", seconds);
- rc = WaitForSingleObject (signal_arrived, ms);
+ rc = pthread::cancelable_wait (signal_arrived, ms);
DWORD now = GetTickCount ();
if (rc == WAIT_TIMEOUT || now >= end_time)
ms = 0;
@@ -97,9 +99,11 @@ sleep (unsigned int seconds)
extern "C" unsigned int
usleep (unsigned int useconds)
{
+ pthread_testcancel ();
+
sig_dispatch_pending (0);
syscall_printf ("usleep (%d)", useconds);
- WaitForSingleObject (signal_arrived, (useconds + 500) / 1000);
+ pthread::cancelable_wait (signal_arrived, (useconds + 500) / 1000);
syscall_printf ("0 = usleep (%d)", useconds);
return 0;
}