mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-14 06:56:51 -04:00
More safety for spinlock
This commit is contained in:
parent
3df6abb169
commit
1ea3f90f4e
@ -15,6 +15,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
void acquire(){
|
void acquire(){
|
||||||
while(!__sync_bool_compare_and_swap(&lock, 0, 1));
|
while(!__sync_bool_compare_and_swap(&lock, 0, 1));
|
||||||
|
__sync_synchronize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void release(){
|
void release(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user