public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pthread_timedjoin_np: return ETIMEDOUT, not EBUSY
@ 2018-06-27 16:24 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2018-06-27 16:24 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=cb3ddf9e2ac1ca094cc0818188248fe10811fa19
commit cb3ddf9e2ac1ca094cc0818188248fe10811fa19
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Wed Jun 27 18:13:38 2018 +0200
Cygwin: pthread_timedjoin_np: return ETIMEDOUT, not EBUSY
pthread_timedjoin_np returns ETIMEDOUT if a thread is still running,
not EBUSY as pthread_tryjoin_np.
Also, clean up initializing timeout in pthread_tryjoin_np.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/thread.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 2734d17..2cbdcf5 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -2472,7 +2472,7 @@ pthread::join (pthread_t *thread, void **return_val, PLARGE_INTEGER timeout)
// set joined thread back to joinable since we got canceled
(*thread)->joiner = NULL;
(*thread)->attr.joinable = PTHREAD_CREATE_JOINABLE;
- return EBUSY;
+ return (timeout && timeout->QuadPart == 0LL) ? EBUSY : ETIMEDOUT;
default:
// should never happen
return EINVAL;
@@ -2588,7 +2588,7 @@ pthread_join (pthread_t thread, void **return_val)
extern "C" int
pthread_tryjoin_np (pthread_t thread, void **return_val)
{
- LARGE_INTEGER timeout = { 0, 0 };
+ LARGE_INTEGER timeout = { QuadPart:0LL };
return pthread::join (&thread, (void **) return_val, &timeout);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-06-27 16:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27 16:24 [newlib-cygwin] Cygwin: pthread_timedjoin_np: return ETIMEDOUT, not EBUSY Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).