| Top |
| gboolean | (*StoragedThreadedJobFunc) () |
| StoragedThreadedJob * | storaged_threaded_job_new () |
| gpointer | storaged_threaded_job_get_user_data () |
| gpointer | job-func | Read / Write / Construct Only |
| gpointer | user-data | Read / Write / Construct Only |
| gpointer | user-data-free-func | Read / Write / Construct Only |
GObject
╰── GDBusInterfaceSkeleton
╰── StoragedJobSkeleton
╰── StoragedBaseJob
╰── StoragedThreadedJob
This type provides an implementation of the StoragedJob interface for jobs that run in a thread.
gboolean (*StoragedThreadedJobFunc) (StoragedThreadedJob *job,GCancellable *cancellable,gpointer user_data,GError **error);
Job function that runs in a separate thread.
Long-running jobs should periodically check cancellable
to see if
they have been cancelled.
StoragedThreadedJob * storaged_threaded_job_new (StoragedThreadedJobFunc job_func,gpointer user_data,GDestroyNotify user_data_free_func,StoragedDaemon *daemon,GCancellable *cancellable);
Creates a new StoragedThreadedJob instance.
The job is started immediately - connect to the “threaded-job-completed” or “completed” signals to get notified when the job is done.
gpointer
storaged_threaded_job_get_user_data (StoragedThreadedJob *job);
Gets the user_data
parameter that job
was constructed with.
typedef struct _StoragedThreadedJob StoragedThreadedJob;
The StoragedThreadedJob structure contains only private data and should only be accessed using the provided API.
“job-func” property “job-func” gpointer
The StoragedThreadedJobFunc to use.
Flags: Read / Write / Construct Only
“user-data” property “user-data” gpointer
User data for the StoragedThreadedJobFunc.
Flags: Read / Write / Construct Only
“user-data-free-func” property “user-data-free-func” gpointer
Free function for user data for the StoragedThreadedJobFunc.
Flags: Read / Write / Construct Only
“threaded-job-completed” signalgboolean user_function (StoragedThreadedJob *job, gboolean result, GError *error, gpointer user_data)
Emitted when the threaded job is complete.
The default implementation simply emits the “completed”
signal with success
set to TRUE if, and only if, error
is
NULL. Otherwise, message
on that signal is set to a string
describing error
. You can avoid the default implementation by
returning TRUE from your signal handler.
This signal is emitted in the
thread-default main loopof the thread that job
was created in.
job |
The StoragedThreadedJob emitting the signal. |
|
result |
The gboolean returned by the StoragedThreadedJobFunc. |
|
error |
The GError set by the StoragedThreadedJobFunc. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last