<
classTTask>
49:
sleep(s > 1 ? s : 1),
67 typedeflist<pair<int, TTask>>
TTasks;
155 template<
classTTask>
160 tasks.emplace_back(0, task);
168 template<
classTTask>
172 autobacklog_end = backlog.end();
175 if(!FillBacklog(backlog_end)) {
180 autoit = backlog.begin();
181 while(it != backlog_end) {
182 if(it->second(++it->first, max_attempts)) {
191 template<
classTTask>
198 if(!tasks.empty()) {
200backlog_end = backlog.begin();
201backlog.splice(backlog_end, tasks);
205}
else if(backlog.empty()) {
206 while(!cond.WaitForSignal(lock));
209}
else if(!cond.WaitForSignal(lock, sleep)) {
216 template<
classTTask>
bool SchedulerImpl(TTask)
TTasks::iterator TTasks_I
list< pair< int, TTask > > TTasks
bool FillBacklog(TTasks_I &)
CExecutor(CContext &context, string thread_name)
CScheduler(CContext &context)
bool operator()(TTask task)
CScheduler & GetScheduler()
CAsyncTaskProcessor(int sleep, int max_attempts, string thread_name)
#define STD_CATCH_ALL(message)
Standard handling of "exception"-derived exceptions; catches non-standard exceptions and generates "u...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
bool Run(TRunMode flags=fRunDefault)
Run the thread.
void SignalSome(void)
Wake at least one of the threads that are currently waiting on this condition variable (if any thread...
bool Discard(void)
If the thread has not been Run() yet, then schedule the thread object for destruction,...
static void SetCurrentThreadName(const CTempString &)
Set name for the current thread.
void Join(void **exit_data=0)
Wait for the thread termination.
Multi-threading â mutexes; rw-locks; semaphore.
Multi-threading â classes, functions, and features.
const string m_ThreadName
void * Main(void)
Derived (user-created) class must provide a real thread function.
SThread(CContext &context, string thread_name)
static CS_CONTEXT * context
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