History

Use WelsThreadJoin on windows as well

This avoids using a separate event just for signalling that a thread has finished running.

Martin Storsjö committed 12 years ago

Commit b4aa9be1 parent 181fe0a3 files · +1 −16Browse files

Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 3 files). Show all

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+0−11
@@ -362,11 +362,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 361 unmodified lines
362362 pSmt->pThreadPEncCtx[iIdx].iThreadIndex = iIdx;
363363 pSmt->pThreadHandles[iIdx] = 0;
364364
365−#ifdef _WIN32
366− WelsSnprintf (name, SEM_NAME_MAX, "fs%d%s", iIdx, pSmt->eventNamespace);
367− err = WelsEventOpen (&pSmt->pFinSliceCodingEvent[iIdx], name);
368− MT_TRACE_LOG ((*ppCtx), WELS_LOG_INFO, "[MT] Open pFinSliceCodingEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
369−#endif//_WIN32
370365 WelsSnprintf (name, SEM_NAME_MAX, "ee%d%s", iIdx, pSmt->eventNamespace);
371366 err = WelsEventOpen (&pSmt->pExitEncodeEvent[iIdx], name);
372367 MT_TRACE_LOG ((*ppCtx), WELS_LOG_INFO, "[MT] Open pExitEncodeEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
@@ -460,8 +455,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 87 unmodified lines
460455 if (pSmt->pThreadHandles != NULL && pSmt->pThreadHandles[iIdx] != NULL)
461456 WelsThreadDestroy (&pSmt->pThreadHandles[iIdx]);
462457
463− WelsSnprintf (ename, SEM_NAME_MAX, "fs%d%s", iIdx, pSmt->eventNamespace);
464− WelsEventClose (&pSmt->pFinSliceCodingEvent[iIdx], ename);
465458 #endif//_WIN32
466459 WelsSnprintf (ename, SEM_NAME_MAX, "ee%d%s", iIdx, pSmt->eventNamespace);
467460 WelsEventClose (&pSmt->pExitEncodeEvent[iIdx], ename);
@@ -957,10 +950,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 489 unmodified lines
957950 }
958951 } while (1);
959952
960−#ifdef _WIN32
961− WelsEventSignal (&pEncPEncCtx->pSliceThreading->pFinSliceCodingEvent[iEventIdx]); // notify to mother encoding threading
962−#endif//WIN32
963−
964953 //sync multi-threading error
965954 WelsMutexLock (&pEncPEncCtx->mutexEncoderError);
966955 if (uiThrdRet) pEncPEncCtx->iEncoderError |= uiThrdRet;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t