#include <thread_tunnel.h>
Inheritance diagram for SigCX::ThreadTunnel:
Public Types | |
enum | Mode { NewThread, CurrentThread, SingleThread } |
Public Member Functions | |
ThreadTunnel (Dispatcher &disp, Mode mode=NewThread) | |
Dispatcher & | dispatcher () |
virtual void | send (Callback *cb, bool sync=false) |
virtual bool | in_sync_callback () |
virtual void | drain () |
Classes | |
class | FatalError |
Exception class. More... |
This tunnel is implemented using a pipe to transfer callbacks from one thread to another. It also has a single-threaded mode in which it uses the pipe anyway. This can be used to code nearly non-blocking UIs without the use of threads.
|
Execution mode of the ThreadTunnel.
|
|
Constructor.
|
|
Get the destination thread dispatcher.
|
|
Drain the tunnel. Any callbacks in the tunnel are cancelled. This is intended to be called at the destination end of the tunnel. Implements SigCX::Tunnel. |
|
Check if tunnel is executing a synchronous callback.
Implements SigCX::Tunnel. |
|
Send a callback to the other side.
Implements SigCX::Tunnel. |