History

add sink to IWelsTask (for further enhancements)

sijchen committed 10 years ago

Commit cce1c291 parent 7bfb96b10 files · +67 −27Browse files

Showing the changes to codec/common/src/WelsThreadPool.cpp (1 of 10 files). Show all

Unified · Split

codec/common/src/WelsThreadPool.cpp+5−5
@@ -133,7 +133,7 @@ WELS_THREAD_ERROR_CODE CWelsThreadPool::Uninit() { · 132 unmodified lines
133}133}
134 134
135void CWelsThreadPool::ExecuteTask() {135void CWelsThreadPool::ExecuteTask() {
136 //WELS_INFO_TRACE("ThreadPool: schedule tasks");136 //printf("ThreadPool: schedule tasks\n");
137 CWelsTaskThread* pThread = NULL;137 CWelsTaskThread* pThread = NULL;
138 IWelsTask* pTask = NULL;138 IWelsTask* pTask = NULL;
139 while (GetWaitedTaskNum() > 0) {139 while (GetWaitedTaskNum() > 0) {
@@ -142,7 +142,7 @@ void CWelsThreadPool::ExecuteTask() { · 2 unmodified lines
142 break;142 break;
143 }143 }
144 pTask = GetWaitedTask();144 pTask = GetWaitedTask();
145 //WELS_INFO_TRACE("ThreadPool: ExecuteTask = "<<(uint32_t)(pTask)<<" at thread = "<<(uint32_t)(pThread));145 //printf("ThreadPool: ExecuteTask = %x at thread %x\n", pTask, pThread);
146 pThread->SetTask (pTask);146 pThread->SetTask (pTask);
147 }147 }
148}148}
@@ -150,12 +150,12 @@ void CWelsThreadPool::ExecuteTask() { · 1 unmodified line
150WELS_THREAD_ERROR_CODE CWelsThreadPool::QueueTask (IWelsTask* pTask) {150WELS_THREAD_ERROR_CODE CWelsThreadPool::QueueTask (IWelsTask* pTask) {
151 CWelsAutoLock cLock (m_cLockPool);151 CWelsAutoLock cLock (m_cLockPool);
152 152
153 //WELS_INFO_TRACE("ThreadPool: QueueTask = "<<(uint32_t)(pTask));153 //printf("ThreadPool: QueueTask = %x\n", pTask);
154 if (GetWaitedTaskNum() == 0) {154 if (GetWaitedTaskNum() == 0) {
155 CWelsTaskThread* pThread = GetIdleThread();155 CWelsTaskThread* pThread = GetIdleThread();
156 156
157 if (pThread != NULL) {157 if (pThread != NULL) {
158 //WELS_INFO_TRACE("ThreadPool: ExecuteTask = "<<(uint32_t)(pTask));158 //printf("ThreadPool: ExecuteTask = %x\n", pTask);
159 pThread->SetTask (pTask);159 pThread->SetTask (pTask);
160 160
161 return WELS_THREAD_ERROR_OK;161 return WELS_THREAD_ERROR_OK;
@@ -163,7 +163,7 @@ WELS_THREAD_ERROR_CODE CWelsThreadPool::QueueTask (IWelsTask* pTask) { · 1 unmodified line
163 }163 }
164 164
165 AddTaskToWaitedList (pTask);165 AddTaskToWaitedList (pTask);
166 166 //printf("ThreadPool: AddTaskToWaitedList: %x\n", pTask);
167 SignalThread();167 SignalThread();
168 return WELS_THREAD_ERROR_OK;168 return WELS_THREAD_ERROR_OK;
169}169}

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