diff options
author | Mike Klein <mtklein@chromium.org> | 2017-02-22 14:33:12 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-22 20:11:54 +0000 |
commit | 19eec39c90a357ff3476d65f2c672096f55518e3 (patch) | |
tree | d028519b3536387f003d3d1b9b1974e596dde703 | |
parent | 91ad074312b1439cc102179e0c9c1daec16aa21d (diff) |
Fix SkSemaphore comments.
Change-Id: I14fc03fcb73bad61daed7c4cd3ed12bfae6b1217
Reviewed-on: https://skia-review.googlesource.com/8880
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
-rw-r--r-- | include/private/SkSemaphore.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/private/SkSemaphore.h b/include/private/SkSemaphore.h index dbc16b64ce..aeca9729dc 100644 --- a/include/private/SkSemaphore.h +++ b/include/private/SkSemaphore.h @@ -22,7 +22,7 @@ public: void signal(int n = 1); // Decrement the counter by 1, - // then if the counter is <= 0, sleep this thread until the counter is > 0. + // then if the counter is < 0, sleep this thread until the counter is >= 0. void wait(); // If the counter is positive, decrement it by 1 and return true, otherwise return false. @@ -40,7 +40,7 @@ private: // // We wrap an OS-provided semaphore with a user-space atomic counter that // lets us avoid interacting with the OS semaphore unless strictly required: - // moving the count from >0 to <=0 or vice-versa, i.e. sleeping or waking threads. + // moving the count from >=0 to <0 or vice-versa, i.e. sleeping or waking threads. struct OSSemaphore; void osSignal(int n); @@ -61,7 +61,7 @@ inline void SkBaseSemaphore::signal(int n) { int prev = fCount.fetch_add(n, std::memory_order_release); // We only want to call the OS semaphore when our logical count crosses - // from <= 0 to >0 (when we need to wake sleeping threads). + // from <0 to >=0 (when we need to wake sleeping threads). // // This is easiest to think about with specific examples of prev and n. // If n == 5 and prev == -3, there are 3 threads sleeping and we signal |