Skip to content

Commit

Permalink
openposixtestsuite: pthread_detach() test 2-1.c does not want to see …
Browse files Browse the repository at this point in the history
…pthread_detach() function return ESRCH return value, but always just EINVAL.
  • Loading branch information
juj committed Dec 18, 2018
1 parent b254af6 commit 3b3baec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/library_pthread.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,8 @@ var LibraryPThread = {
var threadStatus = Atomics.load(HEAPU32, (thread + {{{ C_STRUCTS.pthread.threadStatus }}} ) >> 2);
// Follow musl convention: detached:0 means not detached, 1 means the thread was created as detached, and 2 means that the thread was detached via pthread_detach.
var wasDetached = Atomics.compareExchange(HEAPU32, (thread + {{{ C_STRUCTS.pthread.detached }}} ) >> 2, 0, 2);
return wasDetached ? (threadStatus == 0/*running*/ ? ERRNO_CODES.EINVAL : ERRNO_CODES.ESRCH) : 0;

return wasDetached ? ERRNO_CODES.EINVAL : 0;
},

pthread_exit__deps: ['exit'],
Expand Down

0 comments on commit 3b3baec

Please sign in to comment.