Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | List of all members
faiss::gpu::WorkerThread Class Reference

Public Member Functions

 ~WorkerThread ()
 
void stop ()
 Request that the worker thread stop itself.
 
void waitForThreadExit ()
 
std::future< bool > add (std::function< void()> f)
 

Detailed Description

Definition at line 21 of file WorkerThread.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.


The documentation for this class was generated from the following files: