Sfoglia il codice sorgente

minor fix to semaphore wait

mikymod 12 anni fa
parent
commit
66189549fd
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5 3
      engine/os/win/Semaphore.h

+ 5 - 3
engine/os/win/Semaphore.h

@@ -39,7 +39,7 @@ public:
 	~Semaphore();
 
 	void post(uint32_t count = 1) const;
-	bool wait(int32_t msecs = -1) const;
+	void wait(int32_t msecs = -1) const;
 
 private:
 
@@ -69,8 +69,10 @@ inline void Semaphore::post(uint32_t count) const
 }
 
 //-----------------------------------------------------------------------------
-inline bool Semaphore::wait(int32_t msecs) const
+inline void Semaphore::wait(int32_t msecs) const
 {
 	DWORD milliseconds = (0 > msecs) ? INFINITE : msecs;
-	return WAIT_OBJECT_0 == WaitForSingleObject(m_handle, milliseconds);
+	DWORD result = WaitForSingleObject(m_handle, milliseconds);
+
+	CE_ASSERT(result == WAIT_OBJECT_0, "Semaphore can not signal!");
 }