[gvfs] daemon: Function to schedule a job in a thread
- From: Christian Kellner <gicmo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] daemon: Function to schedule a job in a thread
- Date: Tue, 7 Jun 2011 12:36:17 +0000 (UTC)
commit 16db079fe3eb5c9083cc4d4649bdbaff55e43bbf
Author: Christian Kellner <gicmo gnome org>
Date: Sun Jun 5 12:54:29 2011 +0200
daemon: Function to schedule a job in a thread
Add a public function to schedule a job in the daemon's threadpool
making it possible for e.g. a job to "manually" implement the
try() / run() stages of job execution.
daemon/gvfsdaemon.c | 6 ++++++
daemon/gvfsdaemon.h | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsdaemon.c b/daemon/gvfsdaemon.c
index b3b9ce9..83ba400 100644
--- a/daemon/gvfsdaemon.c
+++ b/daemon/gvfsdaemon.c
@@ -1113,3 +1113,9 @@ g_vfs_daemon_get_blocking_processes (GVfsDaemon *daemon)
return processes;
}
+void
+g_vfs_daemon_run_job_in_thread (GVfsDaemon *daemon,
+ GVfsJob *job)
+{
+ g_thread_pool_push (daemon->thread_pool, job, NULL); /* TODO: Check error */
+}
diff --git a/daemon/gvfsdaemon.h b/daemon/gvfsdaemon.h
index 805b75f..7934873 100644
--- a/daemon/gvfsdaemon.h
+++ b/daemon/gvfsdaemon.h
@@ -71,6 +71,9 @@ void g_vfs_daemon_initiate_mount (GVfsDaemon *daemon,
gboolean is_automount,
DBusMessage *request);
GArray *g_vfs_daemon_get_blocking_processes (GVfsDaemon *daemon);
+void g_vfs_daemon_run_job_in_thread (GVfsDaemon *daemon,
+ GVfsJob *job);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]