This class provides a way to execute application code in the main thread in order to synchronize all the critical code such as access to the model.
More...
#include <ilserver/mvtcp/loopback.h>
|
|
static void | Initialize () |
| | Before you can call any of the methods InvokeNow() or InvokeLater(), you must initialize your IlsTcpLoopback instance using this static member function.
|
| |
| static void | InvokeLater (IlsRunnable &runnable) |
| | This static member function posts the invokation of the run() method of the runnable argument to the main thread and does not wait for the end of execution. More...
|
| |
| static void | InvokeNow (IlsRunnable &runnable) |
| | This static member function invokes the run() member function of the runnable argument in the main thread and waits for the end of execution. More...
|
| |
| static IlsBoolean | InvokeNow (IlsRunnable &runnable, IlsTime to) |
| | This static member function invokes the run() method member of the runnable argument in the main thread and waits for the end of execution with a timeout. More...
|
| |
This class provides a way to execute application code in the main thread in order to synchronize all the critical code such as access to the model.
Library: mvtcp
The different ways (synchronous or asynchronous) to communicate with the main thread are explained below.
◆ InvokeLater()
| static void IlsTcpLoopback::InvokeLater |
( |
IlsRunnable & |
runnable | ) |
|
|
static |
This static member function posts the invokation of the run() method of the runnable argument to the main thread and does not wait for the end of execution.
- Parameters
-
| runnable | runnable to execute |
◆ InvokeNow() [1/2]
| static void IlsTcpLoopback::InvokeNow |
( |
IlsRunnable & |
runnable | ) |
|
|
static |
This static member function invokes the run() member function of the runnable argument in the main thread and waits for the end of execution.
- Parameters
-
| runnable | runnable to execute |
◆ InvokeNow() [2/2]
This static member function invokes the run() method member of the runnable argument in the main thread and waits for the end of execution with a timeout.
If the main thread executes the run() method before the end of timeout, the function returns IlsTrue. When the timeout is elapsed, the run method can no longer be called and the method returns IlsFalse. The runnable parameter is the runnable to execute. The parameter to is the timeout.
- Parameters
-
| runnable | runnable to execute |
| to | timeout |
- Returns
IlsTrue if run before timeout, IlsFalse otherwise.