[SPCA] Synchronization

This commit is contained in:
2026-01-22 07:35:49 +01:00
parent 5dffd7391c
commit f7eeac5470
9 changed files with 40 additions and 9 deletions

View File

@@ -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;
}