ref: de32455d87be611cdfaad08cb0f8c72c22501729
parent: 201ab42d7ea03bea96fe8c3a324694b6daef4ac5
author: Martin Storsjö <[email protected]>
date: Mon Mar 3 16:33:42 EST 2014
Remove the timeout parameter from WelsMultipleEventsWaitSingleBlocking All users of the function passed the value corresponding to "infinite", and the (currently unused) unix implementation of it only supported infinite wait as well.
--- a/codec/common/WelsThreadLib.cpp
+++ b/codec/common/WelsThreadLib.cpp
@@ -118,9 +118,8 @@
}
WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount,
- WELS_EVENT* event_list,
- uint32_t dwMilliseconds) {
- return WaitForMultipleObjects (nCount, event_list, FALSE, dwMilliseconds);
+ WELS_EVENT* event_list) {
+ return WaitForMultipleObjects (nCount, event_list, FALSE, INFINITE);
}
WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitAllBlocking (uint32_t nCount, WELS_EVENT* event_list) {
@@ -339,8 +338,7 @@
}
WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount,
- WELS_EVENT* event_list,
- uint32_t dwMilliseconds) {
+ WELS_EVENT* event_list) {
uint32_t nIdx = 0;
const uint32_t kuiAccessTime = 2; // 2 us once
--- a/codec/common/WelsThreadLib.h
+++ b/codec/common/WelsThreadLib.h
@@ -110,8 +110,7 @@
WELS_THREAD_ERROR_CODE WelsEventSignal (WELS_EVENT* event);
WELS_THREAD_ERROR_CODE WelsEventWait (WELS_EVENT* event);
WELS_THREAD_ERROR_CODE WelsEventWaitWithTimeOut (WELS_EVENT* event, uint32_t dwMilliseconds);
-WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount, WELS_EVENT* event_list,
- uint32_t dwMilliseconds);
+WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount, WELS_EVENT* event_list);
WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitAllBlocking (uint32_t nCount, WELS_EVENT* event_list);
WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_THREAD_ROUTINE routine,
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3271,8 +3271,7 @@
int32_t iEventId = -1;
lwait = WelsMultipleEventsWaitSingleBlocking (iNumThreadsScheduled,
- &pCtx->pSliceThreading->pSliceCodedEvent[0],
- (uint32_t) -1);
+ &pCtx->pSliceThreading->pSliceCodedEvent[0]);
iEventId = (int32_t) (lwait - WELS_THREAD_ERROR_WAIT_OBJECT_0);
if (iEventId >= 0 && iEventId < iNumThreadsScheduled) {
if (iIndexOfSliceToBeCoded < iSliceCount) {
--- a/codec/encoder/core/src/slice_multi_threading.cpp
+++ b/codec/encoder/core/src/slice_multi_threading.cpp
@@ -749,8 +749,7 @@
do {
#ifdef _WIN32
iWaitRet = WelsMultipleEventsWaitSingleBlocking (iEventCount,
- &pEventsList[0],
- (uint32_t) - 1); // blocking until at least one event is
+ &pEventsList[0]); // blocking until at least one event is
#else
MT_TRACE_LOG (pEncPEncCtx, WELS_LOG_INFO,
"[MT] CodingSliceThreadProc(), try to call WelsEventWait(pReadySliceCodingEvent[%d]= 0x%p), pEncPEncCtx= 0x%p!\n",