Now calling WelsThreadJoin is enough to finish and clean up the thread on all platforms. This unifies the thread cleanup code between windows and unix. Now all of the threading code should use the exact same codepaths between windows and unix.
Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 4 files). Show all
Unified · Split
| @@ -451,11 +451,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 450 unmodified lines | ||
| 451 | 451 | char ename[SEM_NAME_MAX] = {0}; |
| 452 | 452 | while (iIdx < iThreadNum) { |
| 453 | 453 | // length of semaphore name should be system constrained at least on mac 10.7 |
| 454 | −#ifdef _WIN32 | |
| 455 | − if (pSmt->pThreadHandles != NULL && pSmt->pThreadHandles[iIdx] != NULL) | |
| 456 | − WelsThreadDestroy (&pSmt->pThreadHandles[iIdx]); | |
| 457 | − | |
| 458 | −#endif//_WIN32 | |
| 459 | 454 | WelsSnprintf (ename, SEM_NAME_MAX, "ee%d%s", iIdx, pSmt->eventNamespace); |
| 460 | 455 | WelsEventClose (&pSmt->pExitEncodeEvent[iIdx], ename); |
| 461 | 456 | WelsSnprintf (ename, SEM_NAME_MAX, "tm%d%s", iIdx, pSmt->eventNamespace); |