HDK
|
#include <UT_ThreadedIO.h>
Public Member Functions | |
UT_ThreadedIO (exint maxqueuebytes) | |
~UT_ThreadedIO () | |
int | awaitIOTaskDone () |
int | awaitIOTaskDoneMS (int64 timeout_ms) |
int | numTasks () const |
void | postTask (UT_UniquePtr< UT_ThreadedIOTask > task) |
UT_ThreadedIO__ takes care of all the thread administration that threaded io requires.
Its features are to maintain single global IO thread to which all desired write jobs are posted.
Definition at line 29 of file UT_ThreadedIO.h.
UT_ThreadedIO::UT_ThreadedIO | ( | exint | maxqueuebytes | ) |
UT_ThreadedIO::~UT_ThreadedIO | ( | ) |
|
inline |
Blocks until next IO task is done. Returns the number of tasks left. Will return immediatenly if no active or pending tasks.
Definition at line 40 of file UT_ThreadedIO.h.
Blocks until next IO task is done or timeout hit, Negative timeout will block forever. Returns immediately if no active or inflight tasks.
int UT_ThreadedIO::numTasks | ( | ) | const |
Current task count. Includes those blocking waiting to be added. Includes those still processing.
void UT_ThreadedIO::postTask | ( | UT_UniquePtr< UT_ThreadedIOTask > | task | ) |
Adds the task to the IO queue. This will block until there is enough free space on the queue.