mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Get threads working on all platforms
We now have a high-quality clone() implementation for creating lightweight threads on Linux/Windows/FreeBSD/NetBSD/OpenBSD.
This commit is contained in:
parent
4e62cefa6e
commit
fec396037a
43 changed files with 850 additions and 532 deletions
|
@ -31,17 +31,6 @@ struct thr_param {
|
|||
struct rtprio *rtp;
|
||||
};
|
||||
|
||||
static inline int thr_new(struct thr_param *param, int param_size) {
|
||||
bool failed;
|
||||
long ax, di, si;
|
||||
asm volatile(CFLAG_ASM("syscall")
|
||||
: CFLAG_CONSTRAINT(failed), "=a"(ax), "=D"(di), "=S"(si)
|
||||
: "1"(455), "2"(param), "3"(param_size)
|
||||
: "rcx", "rdx", "r8", "r9", "r10", "r11", "memory");
|
||||
if (failed) ax = -ax;
|
||||
return ax;
|
||||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_THREAD_FREEBSD_INTERNAL_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue