History

Merge WelsThreadDestroy into WelsThreadJoin

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.

Martin Storsjö committed 12 years ago

Commit 5b8ee371 parent b4aa9be4 files · +1 −32Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+0−13
@@ -2152,18 +2152,6 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 2151 unmodified lines
21522152 const int32_t iThreadCount = (*ppCtx)->pSvcParam->iCountThreadsNum;
21532153 int32_t iThreadIdx = 0;
21542154
2155−#if defined(_WIN32)
2156− if ((*ppCtx)->pSliceThreading->pExitEncodeEvent != NULL) {
2157− do {
2158− if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx] != NULL) // iThreadIdx is already created successfully
2159− WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]);
2160− WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]);
2161− WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit
2162− ++ iThreadIdx;
2163− } while (iThreadIdx < iThreadCount);
2164−
2165− }
2166−#else
21672155 if ((*ppCtx)->pSliceThreading->pExitEncodeEvent != NULL) {
21682156 while (iThreadIdx < iThreadCount) {
21692157 int res = 0;
@@ -2178,7 +2166,6 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 8 unmodified lines
21782166 ++ iThreadIdx;
21792167 }
21802168 }
2181−#endif//WIN32
21822169 }
21832170 #endif//MT_ENABLED
21842171

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