Public Member Functions | |
~WorkerThread () | |
void | stop () |
Request that the worker thread stop itself. | |
void | waitForThreadExit () |
std::future< bool > | add (std::function< void()> f) |
Definition at line 21 of file WorkerThread.h.
faiss::gpu::WorkerThread::~WorkerThread | ( | ) |
Stops and waits for the worker thread to exit, flushing all pending lambdas
Definition at line 25 of file WorkerThread.cpp.
std::future< bool > faiss::gpu::WorkerThread::add | ( | std::function< void()> | f | ) |
Adds a lambda to run on the worker thread; returns a future that can be used to block on its completion. Future status is true
if the lambda was run in the worker thread; false
if it was not run, because the worker thread is exiting or has exited.
Definition at line 44 of file WorkerThread.cpp.
void faiss::gpu::WorkerThread::waitForThreadExit | ( | ) |
Blocking waits in the current thread for the worker thread to stop
Definition at line 107 of file WorkerThread.cpp.