mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-03-14 17:00:05 +01:00
14 lines
218 B
C
14 lines
218 B
C
void acquire( int *lock ) {
|
|
while ( TAS( lock ) == 1 );
|
|
}
|
|
|
|
void acquire_tatas( int *lock ) {
|
|
do {
|
|
while ( *lock == 1 );
|
|
} while ( TAS( lock ) == 1 );
|
|
}
|
|
|
|
void release( int *lock ) {
|
|
*lock = 0;
|
|
}
|