30 os_mutex_init(&uts->
mutex);
40 os_mutex_lock(&uts->
mutex);
44 uts->
arr = realloc(uts->
arr, uts->
length *
sizeof(
void *));
47 uts->
arr[uts->
num++] = ptr;
49 os_mutex_unlock(&uts->
mutex);
57 os_mutex_lock(&uts->
mutex);
60 ret = uts->
arr[--uts->
num];
64 os_mutex_unlock(&uts->
mutex);
74 os_mutex_destroy(&uts->
mutex);
76 if (uts->
arr != NULL) {
size_t num
Definition: u_threading.h:23
void ** arr
Definition: u_threading.h:20
Wrapper around OS threading native functions.
A wrapper around a native mutex.
Definition: os_threading.h:41
struct os_mutex mutex
Definition: u_threading.h:18
Definition: u_threading.h:16
size_t length
Definition: u_threading.h:22