diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2013-01-31 10:41:54 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-01-31 16:09:48 +0200 |
commit | 1569e43af1a559530ae1e4505490b6a953fb8c84 (patch) | |
tree | b1cdc5f5ca8e678b2a2ba76c6b3e5469d31cc03a | |
parent | bb4bb94539ed3e55c1be15d9d4e074506937e878 (diff) | |
download | pacrunner-1569e43af1a559530ae1e4505490b6a953fb8c84.tar.gz |
client: Use pthread instead of obsolete g_thread API
-rw-r--r-- | src/client.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client.c b/src/client.c index c41a738..1919146 100644 --- a/src/client.c +++ b/src/client.c @@ -24,13 +24,14 @@ #endif #include <gdbus.h> +#include <pthread.h> #include "pacrunner.h" struct jsrun_data { DBusConnection *conn; DBusMessage *msg; - GThread *thread; + pthread_t thread; }; static void jsrun_free(gpointer data) @@ -42,7 +43,7 @@ static void jsrun_free(gpointer data) g_free(jsrun); } -static gpointer jsrun_thread(gpointer data) +static void *jsrun_thread(void *data) { struct jsrun_data *jsrun = data; const char *sender, *url, *host; @@ -74,7 +75,7 @@ static gpointer jsrun_thread(gpointer data) jsrun_free(jsrun); - g_thread_exit(NULL); + pthread_exit(NULL); return NULL; } @@ -93,8 +94,7 @@ static DBusMessage *find_proxy_for_url(DBusConnection *conn, jsrun->conn = dbus_connection_ref(conn); jsrun->msg = dbus_message_ref(msg); - jsrun->thread = g_thread_create(jsrun_thread, jsrun, FALSE, NULL); - if (jsrun->thread == NULL) { + if (pthread_create(&jsrun->thread, NULL, jsrun_thread, jsrun) != 0) { jsrun_free(jsrun); return g_dbus_create_error(msg, PACRUNNER_ERROR_INTERFACE ".Failed", |