[gnome-boxes] util: Don't use deprecated GLib.IOSchedulerJob API
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] util: Don't use deprecated GLib.IOSchedulerJob API
- Date: Tue, 4 Mar 2014 20:47:30 +0000 (UTC)
commit 85b7cd40be42283e4b71f9fa0552f9121277dba8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue Mar 4 20:33:23 2014 +0000
util: Don't use deprecated GLib.IOSchedulerJob API
Co-author: Luca Bruno <lucabru src gnome org>
src/Makefile.am | 1 +
src/util.vala | 13 +++++--------
2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index d0f2f1a..a6054f7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -65,6 +65,7 @@ libcommon_a_CFLAGS = $(BOXES_COMMON_CFLAGS)
libcommon_vala.stamp: $(libcommon_a_VALASOURCES)
$(AM_V_VALAC)$(VALAC) $(VALAFLAGS) $(VALA_DEBUG_FLAGS) \
--enable-experimental \
+ --target-glib= GLIB_MIN_VERSION@ \
--vapidir=$(srcdir)/ \
--pkg config \
--pkg glib-2.0 \
diff --git a/src/util.vala b/src/util.vala
index 2c5e0cd..a5efd92 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -190,21 +190,18 @@ namespace Boxes {
public delegate void RunInThreadFunc () throws GLib.Error;
public async void run_in_thread (owned RunInThreadFunc func, Cancellable? cancellable = null) throws
GLib.Error {
GLib.Error e = null;
- GLib.IOSchedulerJob.push ((job, cancellable) => {
+ GLib.SourceFunc resume = run_in_thread.callback;
+ new GLib.Thread<void*> (null, () => {
try {
func ();
} catch (GLib.Error err) {
e = err;
}
- job.send_to_mainloop (() => {
- run_in_thread.callback ();
+ Idle.add ((owned) resume);
- return false;
- });
-
- return false;
- }, GLib.Priority.DEFAULT, cancellable);
+ return null;
+ });
yield;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]