equal
deleted
inserted
replaced
1898 int v; |
1898 int v; |
1899 |
1899 |
1900 // atomically decrement _event |
1900 // atomically decrement _event |
1901 for (;;) { |
1901 for (;;) { |
1902 v = _event; |
1902 v = _event; |
1903 if (Atomic::cmpxchg(v - 1, &_event, v) == v) break; |
1903 if (Atomic::cmpxchg(&_event, v, v - 1) == v) break; |
1904 } |
1904 } |
1905 guarantee(v >= 0, "invariant"); |
1905 guarantee(v >= 0, "invariant"); |
1906 |
1906 |
1907 if (v == 0) { // Do this the hard way by blocking ... |
1907 if (v == 0) { // Do this the hard way by blocking ... |
1908 int status = pthread_mutex_lock(_mutex); |
1908 int status = pthread_mutex_lock(_mutex); |
1938 |
1938 |
1939 int v; |
1939 int v; |
1940 // atomically decrement _event |
1940 // atomically decrement _event |
1941 for (;;) { |
1941 for (;;) { |
1942 v = _event; |
1942 v = _event; |
1943 if (Atomic::cmpxchg(v - 1, &_event, v) == v) break; |
1943 if (Atomic::cmpxchg(&_event, v, v - 1) == v) break; |
1944 } |
1944 } |
1945 guarantee(v >= 0, "invariant"); |
1945 guarantee(v >= 0, "invariant"); |
1946 |
1946 |
1947 if (v == 0) { // Do this the hard way by blocking ... |
1947 if (v == 0) { // Do this the hard way by blocking ... |
1948 struct timespec abst; |
1948 struct timespec abst; |