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

Method threadRoutine

src/common/Task.cpp:50–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50int WorkerThread::threadRoutine()
51{
52 m_state = IDLE;
53 try
54 {
55 m_signalSem.release();
56
57 while (m_state != STOPPING)
58 {
59 m_waitSem.enter();
60
61 if (m_state == RUNNING && m_worker != NULL)
62 {
63 m_worker->work(this);
64 m_worker = NULL;
65 }
66
67 if (m_state == RUNNING)
68 {
69 m_state = IDLE;
70 m_signalSem.release();
71 }
72
73 if (m_state == STOPPING)
74 break;
75 }
76 return 0;
77 }
78 catch (const Firebird::Exception& ex)
79 {
80 iscLogException("Unexpected exception at WorkerThread", ex);
81 }
82
83 if (m_state != SHUTDOWN)
84 m_state = STOPPING;
85
86 return 1;
87}
88
89void WorkerThread::runWorker(Worker* worker)
90{

Callers 1

workerThreadRoutineMethod · 0.80

Calls 4

iscLogExceptionFunction · 0.85
workMethod · 0.80
releaseMethod · 0.45
enterMethod · 0.45

Tested by

no test coverage detected