P4 to Git Change 1087847 by lmoriche@lmoriche_opencl_dev on 2014/10/15 17:33:42

EPR #407144 - Fixes an issue introduced by CL#1082950

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/thread/semaphore.cpp#8 edit
This commit is contained in:
foreman
2014-10-15 17:49:44 -04:00
parent e00c0d6992
commit 42ae4367c2
+4 -2
View File
@@ -43,12 +43,14 @@ Semaphore::~Semaphore()
void
Semaphore::post()
{
int state = state_;
int state = state_.load(std::memory_order_relaxed);
for (;;) {
if (state > 0) {
if (state == state_.load(std::memory_order_acquire)) {
int newstate = state_.load(std::memory_order_acquire);
if (state == newstate) {
return;
}
state = newstate;
continue;
}
if (state_.compare_exchange_weak(state, state+1,