[vala] glib-2.0: add ThreadPool.with_owned_data and ThreadPool.add
- From: Evan Nemerson <evann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] glib-2.0: add ThreadPool.with_owned_data and ThreadPool.add
- Date: Wed, 6 Jun 2012 17:09:55 +0000 (UTC)
commit d284317520032cf6f94529cc87ce95d178618af1
Author: Evan Nemerson <evan coeus-group com>
Date: Wed Jun 6 09:33:32 2012 -0700
glib-2.0: add ThreadPool.with_owned_data and ThreadPool.add
This allows for more intuitive use of ThreadPool. The old bindings
are marked as deprecated but kept in place to maintain backwards
compatibility. Fixes bug 676741.
vapi/glib-2.0.vapi | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index ff1dedf..b5b3783 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -1783,11 +1783,20 @@ namespace GLib {
/* Thread Pools */
+ [CCode (cname = "GFunc")]
+ public delegate void ThreadPoolFunc<G> (owned G data);
+
[Compact]
[CCode (free_function = "g_thread_pool_free")]
public class ThreadPool<T> {
+ [Deprecated (since = "vala-0.18", replacement = "ThreadPool.with_owned_data")]
public ThreadPool (Func<T> func, int max_threads, bool exclusive) throws ThreadError;
+ [CCode (cname = "g_thread_pool_new")]
+ public ThreadPool.with_owned_data (ThreadPoolFunc<T> func, int max_threads, bool exclusive) throws ThreadError;
+ [Deprecated (since = "vala-0.18", replacement = "add")]
public void push (T data) throws ThreadError;
+ [CCode (cname = "g_thread_pool_push")]
+ public void add (owned T data) throws ThreadError;
public void set_max_threads (int max_threads) throws ThreadError;
public int get_max_threads ();
public uint get_num_threads ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]