mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Don't wait in Document::lockToWrite() if timeout = 0
This fixes a lag problem using the arrow keys to move the selection content.
This commit is contained in:
parent
a2cbf3f285
commit
cd07acb6a0
@ -570,9 +570,16 @@ bool Document::lockToWrite(int timeout)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
timeout -= 100;
|
||||
TRACE("Document::lockToWrite: wait 100 msecs for <%d>\n", id());
|
||||
base::this_thread::sleep_for(0.100);
|
||||
|
||||
if (timeout > 0) {
|
||||
int delay = MIN(100, timeout);
|
||||
timeout -= delay;
|
||||
|
||||
TRACE("Document::lockToWrite: wait 100 msecs for <%d>\n", id());
|
||||
base::this_thread::sleep_for(double(delay) / 1000.0);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
TRACE("Document::lockToWrite: Cannot lock <%d> to write (has %d read locks and %d write locks)\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user