Add posix semaphores support

There's still some bugs to work out on Windows and OpenBSD.
This commit is contained in:
Justine Tunney 2022-10-14 08:25:47 -07:00
parent f52f65b2e3
commit 8111462789
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
36 changed files with 779 additions and 59 deletions

View file

@ -62,11 +62,11 @@ static void _mapframe(void *p, int f) {
*/
noasan void *_extend(void *p, size_t n, void *e, int f, intptr_t h) {
char *q;
_npassert(!((uintptr_t)SHADOW(p) & (G - 1)));
_npassert((uintptr_t)p + (G << kAsanScale) <= h);
_unassert(!((uintptr_t)SHADOW(p) & (G - 1)));
_unassert((uintptr_t)p + (G << kAsanScale) <= h);
for (q = e; q < ((char *)p + n); q += 8) {
if (!((uintptr_t)q & (G - 1))) {
_npassert(q + G <= (char *)h);
_unassert(q + G <= (char *)h);
_mapframe(q, f);
if (IsAsan()) {
if (!((uintptr_t)SHADOW(q) & (G - 1))) {