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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user