mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Use *NSYNC for POSIX threads locking APIs
Condition variables, barriers, and r/w locks now work very well.
This commit is contained in:
parent
3de35e196c
commit
b5cb71ab84
197 changed files with 3734 additions and 3817 deletions
|
@ -37,11 +37,12 @@ static void _mapframe(void *p) {
|
|||
if ((dm = sys_mmap(p, G, prot, flags, -1, 0)).addr != p) {
|
||||
notpossible;
|
||||
}
|
||||
if (TrackMemoryInterval(&_mmi, (uintptr_t)p >> 16,
|
||||
((uintptr_t)p + G - 1) >> 16, dm.maphandle, prot,
|
||||
flags, false, false, 0, G)) {
|
||||
__mmi_lock();
|
||||
if (TrackMemoryInterval(&_mmi, (uintptr_t)p >> 16, (uintptr_t)p >> 16,
|
||||
dm.maphandle, prot, flags, false, false, 0, G)) {
|
||||
notpossible;
|
||||
}
|
||||
__mmi_unlock();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,5 +81,6 @@ noasan void *_extend(void *p, size_t n, void *e, intptr_t h) {
|
|||
*SHADOW(q) = 0;
|
||||
}
|
||||
}
|
||||
asm("mfence");
|
||||
return q;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue