aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/thread.cc4
1 files 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);
}