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

Function mutex_trylock

examples/stdlib.c:1572–1585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1570}
1571
1572static __attribute__((__noinline__)) int mutex_trylock(mutex_t *m)
1573{
1574 if (mutex_disabled)
1575 return 0;
1576 pid_t *x = mutex_get_ptr(m);
1577 pid_t self = mutex_gettid();
1578 if (mutex_fast_lock(self, x))
1579 return 0;
1580 else
1581 {
1582 errno = EBUSY;
1583 return -1;
1584 }
1585}
1586
1587static __attribute__((__noinline__)) int mutex_unlock(mutex_t *m)
1588{

Callers

nothing calls this directly

Calls 3

mutex_get_ptrFunction · 0.85
mutex_gettidFunction · 0.85
mutex_fast_lockFunction · 0.85

Tested by

no test coverage detected