equal
deleted
inserted
replaced
62 // operations until this change of _enter succeeds. |
62 // operations until this change of _enter succeeds. |
63 uint old; |
63 uint old; |
64 do { |
64 do { |
65 old = value; |
65 old = value; |
66 *new_ptr = ++value; |
66 *new_ptr = ++value; |
67 value = Atomic::cmpxchg(value, &_enter, old); |
67 value = Atomic::cmpxchg(&_enter, old, value); |
68 } while (old != value); |
68 } while (old != value); |
69 // Critical sections entered before we changed the polarity will use |
69 // Critical sections entered before we changed the polarity will use |
70 // the old exit counter. Critical sections entered after the change |
70 // the old exit counter. Critical sections entered after the change |
71 // will use the new exit counter. |
71 // will use the new exit counter. |
72 volatile uint* old_ptr = &_exit[old & 1]; |
72 volatile uint* old_ptr = &_exit[old & 1]; |