Test and test-and-set: Difference between revisions

Content deleted Content added
use same comment syntax
No edit summary
Line 7:
'''procedure''' EnterCritical() {
'''do''' {
'''while''' (locked == true) yield(); ''// lock looks busy so yield to scheduler''
} '''while''' TestAndSet(locked) ''// actual atomic locking''
}