History

Use pExitEncodeEvent instead of thread cancellation on unix as well

This works now that we've got a suitably working implementation of WelsMultipleEventsWaitSingleBlocking.

Martin Storsjö committed 12 years ago

Commit baaa3871 parent 38a3fad2 files · +12 −13Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+12−11
@@ -2165,18 +2165,19 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 2164 unmodified lines
2165 2165
2166 }2166 }
2167#else2167#else
2168 while (iThreadIdx < iThreadCount) {2168 if ((*ppCtx)->pSliceThreading->pExitEncodeEvent != NULL) {
2169 int res = 0;2169 while (iThreadIdx < iThreadCount) {
2170 if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) {2170 int res = 0;
2171 res = WelsThreadCancel ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]);2171 if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) {
2172 WelsLog (*ppCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), WelsThreadCancel(pThreadHandles%d) return %d..\n", iThreadIdx,2172 WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]);
2173 res);2173 WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]);
2174 res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit2174 res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit
2175 WelsLog (*ppCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..\n", iThreadIdx,2175 WelsLog (*ppCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..\n", iThreadIdx,
2176 res);2176 res);
2177 (*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx] = 0;2177 (*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx] = 0;
2178 }
2179 ++ iThreadIdx;
2178 }2180 }
2179 ++ iThreadIdx;
2180 }2181 }
2181#endif//WIN322182#endif//WIN32
2182 }2183 }

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