m_Data->m_Finished =
true;
91: m_Data(new
SData())
97: m_Data(
prev.m_Data)
124 unsigned intpriority)
126m_StateMutex(state_mutex),
128m_Listener(listener),
165 "CPrefetchToken::SetListener: listener already set");
185 "CPrefetchToken::SetProgress: not processing");
188 if( progress != old_progress ) {
215 catch( prefetch::CCancelRequestException& exc ) {
225m_ThreadPool(
kMax_Int, max_threads, 2, threads_mode)
241 throwprefetch::CCancelRequestException();
267 throwprefetch::CCancelRequestException();
CCancelRequestException(void)
~CCancelRequestException(void)
Base class for all object manager exceptions.
This exception is used to interrupt actions canceled by user.
Abstract class for representing single task executing in pool of threads To use this class in applica...
Base class for a thread running inside CThreadPool and executing tasks.
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Critical(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
friend class CPrefetchRequest
static bool IsActive(void)
CIRef< IPrefetchAction > m_Action
CRef< CObjectFor< CMutex > > m_StateMutex
CRef< CObjectFor< CMutex > > m_StateMutex
virtual void OnStatusChange(EStatus)
Callback to notify on changes in the task status.
virtual EStatus Execute(void)
Do the actual job.
CIRef< IPrefetchListener > m_Listener
CPrefetchManager_Impl(unsigned max_threads, CThread::TRunMode threads_mode)
TProgress SetProgress(TProgress progress)
void SetListener(IPrefetchListener *listener)
IPrefetchAction * GetAction(void) const
CRef< CPrefetchRequest > AddAction(TPriority priority, IPrefetchAction *action, IPrefetchListener *listener)
~CPrefetchManager_Impl(void)
EState GetState(void) const
bool NotNull(void) const THROWS_NONE
Check if pointer is not null â same effect as NotEmpty().
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
T & GetData(void)
Get data as a reference.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
EStatus GetStatus(void) const
Get status of the task.
CRef< CThreadPool_Task > GetCurrentTask(void) const
Get the task currently executing in the thread.
EStatus
Status of the task.
bool IsAborted(void) const
Does method Abort() was already called for this ThreadPool.
bool IsCancelRequested(void) const
Check if cancellation of the task was requested.
void AddTask(CThreadPool_Task *task, const CTimeSpan *timeout=NULL)
Add task to the pool for execution.
@ eIdle
has not been placed in queue yet
@ eQueued
in the queue, awaiting execution
@ eExecuting
being executed
@ eFailed
failure during execution
@ eCompleted
executed successfully
@ eCanceled
canceled - possible only if canceled before processing was started or if method Execute() returns res...
int TRunMode
Bitwise OR'd flags for thread creation passed to Run().
static CThread * GetCurrentThread(void)
Get current CThread object (or NULL, if main thread)
Static variables safety - create on demand, destroy on application termination.
Multi-threading â classes, functions, and features.
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