2019-07-30 06:36:32 -07:00
|
|
|
function @beta EflThreadIOCall {
|
2019-09-18 04:40:05 -07:00
|
|
|
[[A Function to be called asynchronously on a different thread.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
params {
|
2019-09-18 04:40:05 -07:00
|
|
|
@in event: const(event); [[Event struct with an @Efl.Loop_Handler as payload.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-07-30 06:36:32 -07:00
|
|
|
function @beta EflThreadIOCallSync {
|
2019-09-18 04:40:05 -07:00
|
|
|
[[A Function to be called synchronously on another thread.
|
|
|
|
Execution will be stopped until this function returns and its return value can be recovered.
|
|
|
|
]]
|
2018-03-06 03:49:51 -08:00
|
|
|
params {
|
2019-09-18 04:40:05 -07:00
|
|
|
@in event: const(event); [[Event struct with an @Efl.Loop_Handler as payload.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
}
|
2019-09-18 04:40:05 -07:00
|
|
|
return: void_ptr; [[Data that the function executed on the other thread returned.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
};
|
|
|
|
|
2019-02-14 08:37:02 -08:00
|
|
|
mixin @beta Efl.ThreadIO
|
2018-03-06 03:49:51 -08:00
|
|
|
{
|
2019-09-18 04:40:05 -07:00
|
|
|
[[This mixin defines input and output pointers to allow exchanging data with another thread.
|
|
|
|
It also defines a mechanism to call methods on that thread.
|
2019-09-18 03:51:40 -07:00
|
|
|
]]
|
2018-03-06 03:49:51 -08:00
|
|
|
methods {
|
|
|
|
@property indata {
|
2019-09-18 04:40:05 -07:00
|
|
|
[[Input data pointer for the thread.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
set { }
|
|
|
|
get { }
|
|
|
|
values {
|
2019-09-18 04:40:05 -07:00
|
|
|
data: void_ptr; [[Data pointer.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property outdata {
|
2019-09-18 04:40:05 -07:00
|
|
|
[[Output data pointer for the thread.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
set { }
|
|
|
|
get { }
|
|
|
|
values {
|
2019-09-18 04:40:05 -07:00
|
|
|
data: void_ptr; [[Data pointer.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
}
|
|
|
|
}
|
2019-09-18 04:40:32 -07:00
|
|
|
call @pure_virtual {
|
2019-09-18 04:40:05 -07:00
|
|
|
[[Executes a method on a different thread, asynchronously.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
params {
|
2019-09-18 04:40:05 -07:00
|
|
|
func: EflThreadIOCall; [[The method to execute asynchronously.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
}
|
|
|
|
}
|
2019-09-18 04:40:32 -07:00
|
|
|
call_sync @pure_virtual {
|
2019-09-18 04:40:05 -07:00
|
|
|
[[Executes a method on a different thread, synchronously.
|
|
|
|
This call will not return until the method finishes and its return value can be recovered.
|
|
|
|
]]
|
2018-03-06 03:49:51 -08:00
|
|
|
params {
|
2019-09-18 04:40:05 -07:00
|
|
|
func: EflThreadIOCallSync; [[The method to execute synchronously.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
}
|
2019-09-18 04:40:05 -07:00
|
|
|
return: void_ptr; [[The return value from the method.]]
|
2018-03-06 03:49:51 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
events {
|
|
|
|
}
|
|
|
|
implements {
|
|
|
|
}
|
|
|
|
}
|