projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
overhaul SSP support to use a real canary
[oweals/musl.git]
/
src
/
thread
/
__lock.c
1
#include "pthread_impl.h"
2
3
void __lock(volatile int *l)
4
{
5
while (a_swap(l, 1)) __wait(l, l+1, 1, 1);
6
}
7
8
void __unlock(volatile int *l)
9
{
10
a_store(l, 0);
11
if (l[1]) __wake(l, 1, 1);
12
}