~christian-rorvik/crunch.concurrency/trunk

« back to all changes in this revision

Viewing changes to source/platform/win32/system_semaphore.cpp

  • Committer: Christian Rorvik
  • Date: 2011-11-27 20:49:34 UTC
  • Revision ID: christian.rorvik@gmail.com-20111127204934-e35glretrsbq0qhz
Refactored Atomic CompareAndSwap to take comparand as first argument

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        if (count <= 0)
41
41
            return false;
42
42
 
43
 
        if (mCount.CompareAndSwap(count - 1, count))
 
43
        if (mCount.CompareAndSwap(count, count - 1))
44
44
            return true;
45
45
    }
46
46
}