diff options
author | Bruno Haible <bruno@clisp.org> | 2019-06-21 11:59:22 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-06-21 11:59:22 +0200 |
commit | 13644a8180a084c4c682d54f27a2eaab01a92d7f (patch) | |
tree | 532776f64c5f6f8435c176fa80668b8079d12c54 | |
parent | d1cb5add44c04c66e5e6f2967244e71c005f5a46 (diff) | |
download | gnulib-13644a8180a084c4c682d54f27a2eaab01a92d7f.tar.gz gnulib-13644a8180a084c4c682d54f27a2eaab01a92d7f.tar.bz2 |
thrd: Add comment.
* lib/thrd.c (pthread_main_func): Add comment.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/thrd.c | 4 |
2 files changed, 9 insertions, 0 deletions
@@ -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; } } |