summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-06-21 11:59:22 +0200
committerBruno Haible <bruno@clisp.org>2019-06-21 11:59:22 +0200
commit13644a8180a084c4c682d54f27a2eaab01a92d7f (patch)
tree532776f64c5f6f8435c176fa80668b8079d12c54
parentd1cb5add44c04c66e5e6f2967244e71c005f5a46 (diff)
downloadgnulib-13644a8180a084c4c682d54f27a2eaab01a92d7f.tar.gz
gnulib-13644a8180a084c4c682d54f27a2eaab01a92d7f.tar.bz2
thrd: Add comment.
* lib/thrd.c (pthread_main_func): Add comment.
-rw-r--r--ChangeLog5
-rw-r--r--lib/thrd.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4398916057..ffd37618ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2019-06-21 Bruno Haible <bruno@clisp.org>
+ thrd: Add comment.
+ * lib/thrd.c (pthread_main_func): Add comment.
+
+2019-06-21 Bruno Haible <bruno@clisp.org>
+
threads-h: Define 'thread_local' if and only if it actually works.
* m4/threads.m4 (gl_THREAD_LOCAL_DEFINITION): New macro.
(gl_THREADS_H): Define _Thread_local to __thread also for ARM C, IBM C,
diff --git a/lib/thrd.c b/lib/thrd.c
index e8f29bc09c..f3f69496b0 100644
--- a/lib/thrd.c
+++ b/lib/thrd.c
@@ -263,6 +263,10 @@ pthread_main_func (void *pmarg)
/* Execute mainfunc, with arg as argument. */
{
int exitcode = mainfunc (arg);
+ /* Note: When using Windows threads, this exit code is different from the
+ argument passed to ExitThread(), because the latter should never be 259,
+ see <https://docs.microsoft.com/de-de/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getexitcodethread>,
+ whereas the exit code passed to thrd_exit() is not constrained. */
return (void *) (intptr_t) exitcode;
}
}

Return to:

Send suggestions and report system problems to the System administrator.