mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Add pthread tls api
This commit is contained in:
parent
0e773e23ad
commit
9545062175
15 changed files with 333 additions and 7 deletions
|
@ -29,7 +29,7 @@
|
|||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/thread/thread.h"
|
||||
|
||||
static textstartup void _main_thread_init(void) {
|
||||
textstartup void _main_thread_init(void) {
|
||||
_Static_assert(offsetof(struct cthread_descriptor_t, self) == 0x00, "");
|
||||
_Static_assert(offsetof(struct cthread_descriptor_t, self2) == 0x30, "");
|
||||
_Static_assert(offsetof(struct cthread_descriptor_t, tid) == 0x38, "");
|
||||
|
@ -65,10 +65,4 @@ static textstartup void _main_thread_init(void) {
|
|||
|
||||
// Set FS
|
||||
__install_tls((char *)td);
|
||||
assert(cthread_self()->tid == gettid());
|
||||
__threaded = true;
|
||||
}
|
||||
|
||||
const void *const _main_thread_ctor[] initarray = {
|
||||
_main_thread_init,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue