Package org.gnome.gio
Interface TaskThreadFunc
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Generated("io.github.jwharm.JavaGI")
public interface TaskThreadFunc
extends FunctionPointer
Functional interface declaration of the
TaskThreadFunc
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run
(Task task, GObject sourceObject, @Nullable MemorySegment taskData, @Nullable Cancellable cancellable) The prototype for a task function to be run in a thread via g_task_run_in_thread() or g_task_run_in_thread_sync().default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default void
upcall
(MemorySegment task, MemorySegment sourceObject, MemorySegment taskData, MemorySegment cancellable) Theupcall
method is called from native code.
-
Method Details
-
run
void run(Task task, GObject sourceObject, @Nullable @Nullable MemorySegment taskData, @Nullable @Nullable Cancellable cancellable) The prototype for a task function to be run in a thread via g_task_run_in_thread() or g_task_run_in_thread_sync().If the return-on-cancel flag is set on
task
, andcancellable
gets cancelled, then theGTask
will be completed immediately (as though g_task_return_error_if_cancelled() had been called), without waiting for the task function to complete. However, the task function will continue running in its thread in the background. The function therefore needs to be careful about how it uses externally-visible state in this case. See g_task_set_return_on_cancel() for more details.Other than in that case,
task
will be completed when theGTaskThreadFunc
returns, not when it calls ag_task_return_
function. -
upcall
default void upcall(MemorySegment task, MemorySegment sourceObject, MemorySegment taskData, MemorySegment cancellable) Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.gio.Task, org.gnome.gobject.GObject, java.lang.foreign.MemorySegment, org.gnome.gio.Cancellable)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-