Qore Programming Language 1.14.2
|
use this class to temporarily register and deregister a foreign thread to allow Qore code to be executed and the Qore library to be used from threads not created by the Qore library More...
#include <qore_thread.h>
Public Member Methods | |
DLLEXPORT | QoreForeignThreadHelper () |
registers the current thread as a foreign thread More... | |
DLLEXPORT | QoreForeignThreadHelper (int tid) |
registers the current thread as a foreign thread More... | |
DLLEXPORT | ~QoreForeignThreadHelper () |
deregisters the current thread More... | |
DLLEXPORT | operator bool () const |
returns true if the object is valid, false if not | |
use this class to temporarily register and deregister a foreign thread to allow Qore code to be executed and the Qore library to be used from threads not created by the Qore library
DLLEXPORT QoreForeignThreadHelper::QoreForeignThreadHelper | ( | ) |
registers the current thread as a foreign thread
the thread will be deregistered with q_deregister_foreign_thread() in the destructor
|
explicit |
registers the current thread as a foreign thread
The tid given must be already reserved with q_reserve_foreign_thread_id(); the thread will be deregistered with q_deregister_reserved_foreign_thread() in the destructor
DLLEXPORT QoreForeignThreadHelper::~QoreForeignThreadHelper | ( | ) |
deregisters the current thread
deregistration is only performed if the original registration in the constructor was successful. In this case either q_deregister_foreign_thread() or q_reserve_foreign_thread_id() will be called, depending on the action taken in the constructor