mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 23:48:21 +00:00
We now have a high-quality clone() implementation for creating lightweight threads on Linux/Windows/FreeBSD/NetBSD/OpenBSD.
24 lines
581 B
C
24 lines
581 B
C
#ifndef COSMOPOLITAN_LIBC_RUNTIME_WINTHREAD_INTERNAL_H_
|
|
#define COSMOPOLITAN_LIBC_RUNTIME_WINTHREAD_INTERNAL_H_
|
|
#include "libc/intrin/tls.h"
|
|
#include "libc/runtime/runtime.h"
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
COSMOPOLITAN_C_START_
|
|
|
|
struct WinThread {
|
|
uint32_t tid;
|
|
int flags;
|
|
int *ctid;
|
|
int (*func)(void *);
|
|
void *arg;
|
|
};
|
|
|
|
extern int __winthread;
|
|
|
|
static inline struct WinThread *GetWinThread(void) {
|
|
return TlsGetValue(__winthread);
|
|
}
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_LIBC_RUNTIME_WINTHREAD_INTERNAL_H_ */
|