ref: f96e7e4b06b8fe0ae4fa03a578eec4f84d740717
parent: 35d921ba9803422ec0c7b5bd53a5d0530388783e
author: Martin Storsjö <martin@martin.st>
date: Fri Apr 28 07:58:09 EDT 2017
Fix threading on windows after c51a4ff09 After this commit, is is expected that WelsEventSignal decrements the integer - but this wasn't done on windows.
--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -141,8 +141,11 @@
}
WELS_THREAD_ERROR_CODE WelsEventSignal (WELS_EVENT* event, WELS_MUTEX *pMutex, int* iCondition) {
- if (SetEvent (*event)) {
- return WELS_THREAD_ERROR_OK;
+ (*iCondition) --;
+ if ((*iCondition) <= 0) {
+ if (SetEvent (*event)) {
+ return WELS_THREAD_ERROR_OK;
+ }
}
return WELS_THREAD_ERROR_GENERAL;
}