[libc] Take 2: Add linux implementations of thrd_create and thrd_join functions.
authorSiva Chandra Reddy <sivachandra@google.com>
Fri, 6 Mar 2020 23:05:50 +0000 (15:05 -0800)
committerSiva Chandra Reddy <sivachandra@google.com>
Tue, 10 Mar 2020 04:28:11 +0000 (21:28 -0700)
commitfd8c13361348f32acef8f8a972984bb5f0786a0c
treef9b8fd24e3acbe1ddbad8e001948919f8cbdb4ac
parentf80c6d8dec1866424d66a0b1ab67c082e2d08375
[libc] Take 2: Add linux implementations of thrd_create and thrd_join functions.

The following are the differences from the first version:

1. The kernel does not copy the stack for the new thread (it cannot).
The previous version missed this fact. In this new version, the new
thread's start args are copied on to the new stack in a known location
so that the new thread can sniff them out.
2. A start args sniffer for x86_64 has been added.
2. Default stack size has been increased to 64KB.

Reviewers: abrachet, phosek

Differential Revision: https://reviews.llvm.org/D75818
19 files changed:
libc/cmake/modules/LLVMLibCRules.cmake
libc/config/linux/api.td
libc/config/linux/threads.h.in [new file with mode: 0644]
libc/include/CMakeLists.txt
libc/include/threads.h.def
libc/lib/CMakeLists.txt
libc/src/CMakeLists.txt
libc/src/threads/CMakeLists.txt [new file with mode: 0644]
libc/src/threads/linux/CMakeLists.txt [new file with mode: 0644]
libc/src/threads/linux/thrd_create.cpp [new file with mode: 0644]
libc/src/threads/linux/thrd_join.cpp [new file with mode: 0644]
libc/src/threads/linux/thread_start_args.h.def [new file with mode: 0644]
libc/src/threads/linux/thread_utils.h [new file with mode: 0644]
libc/src/threads/linux/x86_64/thread_start_args.h.in [new file with mode: 0644]
libc/src/threads/thrd_create.h [new file with mode: 0644]
libc/src/threads/thrd_join.h [new file with mode: 0644]
libc/test/src/CMakeLists.txt
libc/test/src/threads/CMakeLists.txt [new file with mode: 0644]
libc/test/src/threads/thrd_test.cpp [new file with mode: 0644]