Commit 2693e753 by Lingfeng Yang

Check count > 0 not != 0 in Resource acquisition.

On low-resolution Android Emulator AVDs run with -gpu swiftshader_indirect, it's possible to run fast enough to see count == -1 on Resource acquisition. Check for that. bug: 70950184 Test: API 27 Chrome is usable on a 480x800 or smaller device Change-Id: I4f4cf9cd0ab1bc2bce846f0af6ffbbe243bc1a96 Reviewed-on: https://swiftshader-review.googlesource.com/15508Reviewed-by: 's avatarLingfeng Yang <lfy@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarLingfeng Yang <lfy@google.com>
parent 74384981
...@@ -38,7 +38,7 @@ namespace sw ...@@ -38,7 +38,7 @@ namespace sw
{ {
criticalSection.lock(); criticalSection.lock();
while(count != 0 && accessor != claimer) while(count > 0 && accessor != claimer)
{ {
blocked++; blocked++;
criticalSection.unlock(); criticalSection.unlock();
...@@ -84,7 +84,7 @@ namespace sw ...@@ -84,7 +84,7 @@ namespace sw
} }
// Acquire // Acquire
while(count != 0 && accessor != claimer) while(count > 0 && accessor != claimer)
{ {
blocked++; blocked++;
criticalSection.unlock(); criticalSection.unlock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment