mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 12:18:31 +00:00
Get rid of kmalloc()
This changes *NSYNC to allocate waiters on the stack so our locks don't need to depend on dynamic memory. This make our runtiem simpler, and it also fixes bugs with thread cancellation support.
This commit is contained in:
parent
77a7873057
commit
a359de7893
57 changed files with 405 additions and 472 deletions
3
third_party/nsync/mu_semaphore.h
vendored
3
third_party/nsync/mu_semaphore.h
vendored
|
@ -11,6 +11,9 @@ typedef struct nsync_semaphore_s_ {
|
|||
/* Initialize *s; the initial value is 0. */
|
||||
void nsync_mu_semaphore_init(nsync_semaphore *s);
|
||||
|
||||
/* Releases system resources associated with *s. */
|
||||
void nsync_mu_semaphore_destroy(nsync_semaphore *s);
|
||||
|
||||
/* Wait until the count of *s exceeds 0, and decrement it. */
|
||||
errno_t nsync_mu_semaphore_p(nsync_semaphore *s);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue