mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-04-28 22:29:23 +02:00
[SPCA] Synchronization
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user