thrd: Add comment.
authorBruno Haible <bruno@clisp.org>
Fri, 21 Jun 2019 09:59:22 +0000 (11:59 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 21 Jun 2019 09:59:22 +0000 (11:59 +0200)
* lib/thrd.c (pthread_main_func): Add comment.

ChangeLog
lib/thrd.c

index 4398916057b2650abf9f11e41de2c9299c094c54..ffd37618ee5a840550ed9ed36b3aa205c5bb1ab0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
index e8f29bc09cc3e9b1a6c92da2f39c7932863c3728..f3f69496b00f1a1a3ea7d0d0c095da06ee439084 100644 (file)
@@ -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;
   }
 }