mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-04 00:40:27 +00:00
Make more improvements to threading support
- fix rare thread exit race condition on openbsd - pthread_getattr_np() now supplies detached status - child threads may now pthread_join() the main thread - introduce sigandset(), sigorset(), and sigisemptyset() - introduce pthread_cleanup_push() and pthread_cleanup_pop()
This commit is contained in:
parent
38df0a4186
commit
4a6fd3d910
52 changed files with 586 additions and 241 deletions
|
@ -16,19 +16,24 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asmflag.h"
|
||||
#include "libc/intrin/promises.internal.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/nt/thread.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
#include "libc/thread/tls.h"
|
||||
|
||||
__msabi extern typeof(ExitThread) *const __imp_ExitThread;
|
||||
|
||||
/**
|
||||
* Terminates thread with raw system call.
|
||||
*
|
||||
* The function you want is pthread_exit(). If you call this function
|
||||
* whilst using the pthreads then your joiners might not get woken up
|
||||
* on non-Linux platforms where we zero __get_tls()->tib_tid manually
|
||||
*
|
||||
* If this is the main thread, or an orphaned child thread, then this
|
||||
* function is equivalent to exiting the process; however, `rc` shall
|
||||
* only be reported to the parent process on Linux, FreeBSD & Windows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue