[an error occurred while processing this directive]
Next: Partial store ordering
Up: 10-smp
Previous: Other Memory Models
Subsections
| ||||||||||||
|
| void lock (volatile lock_t *l) { |
l->status[MYSELF] = LOCKED; |
while (l->status[OTHER] == LOCKED) { |
if (l->turn != MYSELF) { |
l->status[MYSELF] = !LOCKED; |
while (l->turn == OTHER) ; |
l->status[MYSELF] = LOCKED; |
| } } } |