IOSchedulerJob

Description Schedules asynchronous I/O operations. GIOScheduler integrates into the main event loop (GMainLoop) and may use threads if they are available. Each I/O operation has a priority, and the scheduler uses the priorities to determine the order in which operations are executed. They are not used to determine system-wide I/O scheduling. Priorities are integers, with lower numbers indicating higher priority. It is recommended to choose priorities between G_PRIORITY_LOW and G_PRIORITY_HIGH, with G_PRIORITY_DEFAULT as a default.

Constructors

this
this(GIOSchedulerJob* gIOSchedulerJob)

Sets our main struct and passes it to the parent class

Members

Functions

getIOSchedulerJobStruct
GIOSchedulerJob* getIOSchedulerJobStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

sendToMainloop
int sendToMainloop(GSourceFunc func, void* userData, GDestroyNotify notify)

Used from an I/O job to send a callback to be run in the thread that the job was started from, waiting for the result (and thus blocking the I/O job).

sendToMainloopAsync
void sendToMainloopAsync(GSourceFunc func, void* userData, GDestroyNotify notify)

Used from an I/O job to send a callback to be run asynchronously in the thread that the job was started from. The callback will be run when the main loop is available, but at that time the I/O job might have finished. The return value from the callback is ignored. Note that if you are passing the user_data from g_io_scheduler_push_job() on to this function you have to ensure that it is not freed before func is called, either by passing NULL as notify to g_io_scheduler_push_job() or by using refcounting for user_data.

Static functions

cancelAllJobs
void cancelAllJobs()

Cancels all cancellable I/O jobs. A job is cancellable if a GCancellable was passed into g_io_scheduler_push_job().

pushJob
void pushJob(GIOSchedulerJobFunc jobFunc, void* userData, GDestroyNotify notify, int ioPriority, Cancellable cancellable)

Schedules the I/O job to run. notify will be called on user_data after job_func has returned, regardless whether the job was cancelled or has run to completion. If cancellable is not NULL, it can be used to cancel the I/O job by calling g_cancellable_cancel() or by calling g_io_scheduler_cancel_all_jobs().

Variables

gIOSchedulerJob
GIOSchedulerJob* gIOSchedulerJob;

the main Gtk struct

Meta