1 module glib.gthreadpool;
2 
3 import glib.gtypes;
4 import glib.gthread;
5 import glib.gerror;
6 
7 
8 struct GThreadPool
9 {
10   GFunc func;
11   gpointer user_data;
12   gboolean exclusive;
13 }
14 
15 extern (C) {
16 
17 
18     GThreadPool *   g_thread_pool_new               (GFunc            func,
19                                                      gpointer         user_data,
20                                                      gint             max_threads,
21                                                      gboolean         exclusive,
22                                                      GError         **error);
23 
24     void            g_thread_pool_free              (GThreadPool     *pool,
25                                                      gboolean         immediate,
26                                                      gboolean         wait_);
27 
28     gboolean        g_thread_pool_push              (GThreadPool     *pool,
29                                                      gpointer         data,
30                                                      GError         **error);
31 
32     guint           g_thread_pool_unprocessed       (GThreadPool     *pool);
33 
34     void            g_thread_pool_set_sort_function (GThreadPool      *pool,
35                                                      GCompareDataFunc  func,
36                                                      gpointer          user_data);
37 
38     gboolean        g_thread_pool_set_max_threads   (GThreadPool     *pool,
39                                                      gint             max_threads,
40                                                      GError         **error);
41 
42     gint            g_thread_pool_get_max_threads   (GThreadPool     *pool);
43 
44     guint           g_thread_pool_get_num_threads   (GThreadPool     *pool);
45 
46 
47     void            g_thread_pool_set_max_unused_threads (gint  max_threads);
48 
49     gint            g_thread_pool_get_max_unused_threads ();
50 
51     guint           g_thread_pool_get_num_unused_threads ();
52 
53     void            g_thread_pool_stop_unused_threads    ();
54 
55     void            g_thread_pool_set_max_idle_time      (guint interval);
56 
57     guint           g_thread_pool_get_max_idle_time      ();
58 
59 }
60