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

Method handler

src/common/classes/TimerImpl.cpp:34–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace Firebird {
33
34void TimerImpl::handler()
35{
36 {
37 MutexLockGuard guard(m_mutex, FB_FUNCTION);
38 fb_assert(!m_handlerTid);
39
40 m_fireTime = 0;
41 if (!m_expTime) // Timer was reset to zero or stopped, do nothing
42 return;
43
44 // If timer was reset to fire later, restart ITimer
45
46 const SINT64 curTime = fb_utils::query_performance_counter() / fb_utils::query_performance_frequency();
47
48 if (m_expTime > curTime)
49 {
50 reset(m_expTime - curTime);
51 return;
52 }
53 m_expTime = 0;
54
55 if (m_onTimer)
56 m_handlerTid = Thread::getCurrentThreadId();
57 }
58
59 if (!m_onTimer)
60 return;
61
62 m_onTimer(this);
63
64 MutexLockGuard guard(m_mutex, FB_FUNCTION);
65 m_handlerTid = 0;
66}
67
68void TimerImpl::reset(unsigned int timeout)
69{

Callers 1

workMethod · 0.45

Calls 3

resetFunction · 0.50

Tested by

no test coverage detected