Skip to content

Commit

Permalink
Document usage of sleep_for
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjv authored and TheOneRing committed Sep 1, 2023
1 parent 4a1f708 commit c585dad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libsync/platform_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void WinPlatform::startShutdownWatcher()
MSG msg;
while (watchWMCtx.windowMessageWatcherRun) {
if (!PeekMessageW(&msg, watcherWindow, 0, 0, PM_REMOVE)) {
// We are in a separate thread, and polling for events. When no events are queued, wait a bit before peeking in the queue again.
std::this_thread::sleep_for(100ms);
} else {
TranslateMessage(&msg);
Expand Down

0 comments on commit c585dad

Please sign in to comment.