mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-27 21:10:29 +00:00
Add posix semaphores support
There's still some bugs to work out on Windows and OpenBSD.
This commit is contained in:
parent
f52f65b2e3
commit
8111462789
36 changed files with 779 additions and 59 deletions
|
@ -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))) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define _POLLTRACE 0 /* not configurable w/ flag yet */
|
||||
#define _DATATRACE 1 /* not configurable w/ flag yet */
|
||||
#define _STDIOTRACE 0 /* not configurable w/ flag yet */
|
||||
#define _NTTRACE 0 /* not configurable w/ flag yet */
|
||||
#define _NTTRACE 1 /* not configurable w/ flag yet */
|
||||
|
||||
#define STRACE_PROLOGUE "%rSYS %6P %'18T "
|
||||
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/atomic.h"
|
||||
#include "libc/sysv/consts/clock.h"
|
||||
#include "libc/thread/freebsd.internal.h"
|
||||
|
||||
int sys_umtx_timedwait_uint(int *p, int expect, bool pshare,
|
||||
int sys_umtx_timedwait_uint(atomic_int *p, int expect, bool pshare,
|
||||
const struct timespec *abstime) {
|
||||
int op;
|
||||
size_t size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue