MCPcopy Create free account
hub / github.com/GJDuck/e9patch / mutex_fast_lock

Function mutex_fast_lock

examples/stdlib.c:1507–1511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1505#endif /* MUTEX_SAFE */
1506
1507static bool mutex_fast_lock(pid_t self, pid_t *x)
1508{
1509 pid_t owner = __sync_val_compare_and_swap(x, 0, self);
1510 return (owner == 0);
1511}
1512
1513static bool mutex_fast_unlock(pid_t self, pid_t *x)
1514{

Callers 2

mutex_lockFunction · 0.85
mutex_trylockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected