Use the correct unit of time for WaitForSingleObject
authorMikko Rasa <tdb@tdb.fi>
Tue, 20 Sep 2016 00:40:46 +0000 (03:40 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 20 Sep 2016 00:40:46 +0000 (03:40 +0300)
source/core/windows/semaphore.cpp

index aeb1709241d31993495ad8d97c6ee4f2aa197009..749d99313c3f356fa042b8a8a77a54fcb5cc91ff 100644 (file)
@@ -38,7 +38,7 @@ void Semaphore::wait()
 
 bool Semaphore::wait(const Time::TimeDelta &d)
 {
-       DWORD ret = WaitForSingleObject(priv->handle, (DWORD)(d/Time::usec));
+       DWORD ret = WaitForSingleObject(priv->handle, static_cast<DWORD>(d/Time::msec));
        if(ret==WAIT_FAILED)
                throw system_error("WaitForSingleObject");
        return ret==WAIT_OBJECT_0;