mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-10-09 11:46:20 +02:00
[SPCA] Synchronization
This commit is contained in:
1 parent
5dffd7391c
commit
f7eeac5470
9 files changed
+40
-9
No files matched your search
@@ -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;
|
||||
}
|
||||
Whitespace-only changes.
Reference in new issue
Block a user