summaryrefslogtreecommitdiff
path: root/libc/src/threads/linux/thrd_create.cpp
AgeCommit message (Collapse)Author
2022-04-07[libc] Add a linux Thread class in __support/threads.Siva Chandra Reddy
This change is essentially a mechanical change which moves the thread creation and join implementations from src/threads/linux to src/__support/threads/linux/thread.h. The idea being that, in future, a pthread implementation can reuse the common thread implementations in src/__support/threads. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D123287
2022-04-02[libc][NFC] Do not call mmap and munmap from thread functions.Siva Chandra Reddy
Instead, memory is allocated and deallocated using mmap and munmap syscalls directly. Reviewed By: lntue, michaelrj Differential Revision: https://reviews.llvm.org/D122876
2022-03-31[libc] Enable threads.h functions on aarch64.Siva Chandra
Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D122788
2022-03-01[libc] Remove the remaining uses of stdatomic.h.Siva Chandra Reddy
New methods to the Atomic class have been added as required. Futex related types have been consolidated at a common place. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D120705
2021-12-22[libc] Move the x86_64 syscall functions to OSUtil.Siva Chandra Reddy
Reviewed By: michaelrj, lntue Differential Revision: https://reviews.llvm.org/D116177
2021-12-07[libc] apply new lint rulesMichael Jones
This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302
2021-08-30[libc] Ensure the result of the clone syscall is not on stack in thrd_create.Siva Chandra Reddy
Also, added a call to munmap on error in thrd_create.
2021-08-26[libc][NFC] Move the mutex implementation into a utility class.Siva Chandra Reddy
This allows others parts of the libc to use the mutex types without actually pulling in public function implementations. Along the way, few cleanups have been done, like using a uniform type to refer the linux futex word. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D108749
2021-01-09[libc][NFC] add includes for internal headers to all libc functionsMichael Jones
this will make sure that all of the functions are using the correct prototypes. Explained much better in the comments of this diff: https://reviews.llvm.org/D94195
2021-01-08[libc] Switch to use a macro which does not insert a section for every libc ↵Michael Jones
function. Summary: The new macro also inserts the C alias for the C++ implementations without needing an objcopy based post processing step. The CMake rules have been updated to reflect this. More CMake cleanup can be taken up in future rounds and appropriate TODOs have been added for them. Reviewers: mcgrathr, sivachandra Subscribers:
2020-04-08[libc][NFC] Make all top of file comments consistent.Paula Toth
Summary: Made all header files consistent based of this documentation: https://llvm.org/docs/CodingStandards.html#file-headers. And did the same for all source files top of file comments. Reviewers: sivachandra, abrachet Reviewed By: sivachandra, abrachet Subscribers: MaskRay, tschuett, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D77533
2020-03-09[libc] Take 2: Add linux implementations of thrd_create and thrd_join functions.Siva Chandra Reddy
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
2020-03-05[libc]Revert "Add linux implementations of thrd_create and thrd_join functions."Siva Chandra Reddy
This reverts commit abc040e9533011a62a25c93b07b4fc31c8a641f7 as the bots are failing because of this.
2020-03-05[libc] Add linux implementations of thrd_create and thrd_join functions.Siva Chandra Reddy
Reviewers: abrachet, phosek Differential Revision: https://reviews.llvm.org/D75380