MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / work

Method work

src/common/Task.cpp:134–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132/// class Worker
133
134bool Worker::work(WorkerThread* thd)
135{
136 fb_assert(m_state == READY);
137
138 m_state = WORKING;
139 m_thread = thd;
140 Task::WorkItem* workItem = NULL;
141 while (true)
142 {
143 if (m_thread && m_thread->getState() != WorkerThread::RUNNING)
144 break;
145
146 if (!m_task->getWorkItem(&workItem))
147 break;
148
149 if (!m_task->handler(*workItem))
150 break;
151 }
152
153 m_thread = NULL;
154 m_state = IDLE;
155 return true;
156}
157
158bool Worker::waitFor(int timeout)
159{

Callers 2

threadRoutineMethod · 0.80
runSyncMethod · 0.80

Calls 3

getStateMethod · 0.45
getWorkItemMethod · 0.45
handlerMethod · 0.45

Tested by

no test coverage detected