intr = boost::intrusive;
48 structSTimerList_tag;
49 typedefintr::list_base_hook<intr::tag<STimerList_tag>,
64intr::base_hook<TTimerListHook>,
80 if(ticket_time <= cur_time)
81ticket_time = ticket->
timer_time= cur_time + 1;
108 while(!tlist.empty()) {
127 gotoretry_set_flags;
138 while(!tlist.empty()) {
159 for(
intfire_time = cur_time; fire_time <= cur_time +
kTimerLowMask; ++fire_time)
166 while(!tlist.empty()) {
181 for(
intfire_time =
s_LastFiredTime+ 1; fire_time <= cur_time; ++fire_time)
219ticket->
task=
this;
Mutex created to have minimum possible size (its size is 4 bytes) and to sleep using kernel capabilit...
void Unlock(void)
Unlock the mutex.
void Lock(void)
Lock the mutex.
Main working entity in TaskServer.
TSrvTaskFlags m_TaskFlags
Bit-OR of flags for this task.
void RunAfter(Uint4 delay_sec)
This call is basically equivalent to SetRunnable() but with guarantee that task will be scheduled for...
STimerTicket * m_Timer
Timer ticket assigned to this task when it calls RunAfter().
void SetRunnable(bool boost=false)
Set this task "runnable", i.e.
static int CurSecs(void)
Current time in seconds since epoch (time_t).
static bool IsInShutdown(void)
Checks if TaskServer received request to shutdown.
void Critical(CExceptionArgs_Base &args)
uint8_t Uint1
1-byte (8-bit) unsigned integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define SRV_LOG(sev, msg)
Macro to be used for printing log messages.
#define ACCESS_ONCE(x)
Purpose of this macro is to force compiler to access variable exactly at the place it's written (no m...
bool AtomicCAS(T volatile &var, T old_value, T new_value)
static void s_ExecuteTimerTicket(STimerTicket *ticket)
intr::list< STimerTicket, intr::base_hook< TTimerListHook >, intr::constant_time_size< false > > TTimerList
intr::list_base_hook< intr::tag< STimerList_tag >, intr::link_mode< intr::auto_unlink > > TTimerListHook
static void s_AddTimerTicket(STimerTicket *ticket)
static void s_ShiftTimers(int fire_time)
static TTimerList s_TimerLowQ[kTimerLowMask+1]
static const Uint1 kTimerMidBits
static void s_FireTimers(int fire_time)
static const int kTimerLowMask
static TTimerList s_TimerMidQ[kTimerMidLevels][kTimerMidMask+1]
static const Uint1 kTimerLowBits
static const Uint1 kTimerMidLevels
static const int kTimerMidMask
void RemoveTaskFromTimer(CSrvTask *task, TSrvTaskFlags new_flags)
static int s_LastFiredTime
static CMiniMutex s_TimerLock
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4