Use *NSYNC for POSIX threads locking APIs

Condition variables, barriers, and r/w locks now work very well.
This commit is contained in:
Justine Tunney 2022-09-11 11:02:07 -07:00
parent 3de35e196c
commit b5cb71ab84
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
197 changed files with 3734 additions and 3817 deletions

View file

@ -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;
}