File indexing completed on 2026-05-06 08:41:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef __G_THREADPOOL_H__
0028 #define __G_THREADPOOL_H__
0029
0030 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0031 #error "Only <glib.h> can be included directly."
0032 #endif
0033
0034 #include <glib/gthread.h>
0035
0036 G_BEGIN_DECLS
0037
0038 typedef struct _GThreadPool GThreadPool;
0039
0040
0041
0042
0043 struct _GThreadPool
0044 {
0045 GFunc func;
0046 gpointer user_data;
0047 gboolean exclusive;
0048 };
0049
0050 GLIB_AVAILABLE_IN_ALL
0051 GThreadPool * g_thread_pool_new (GFunc func,
0052 gpointer user_data,
0053 gint max_threads,
0054 gboolean exclusive,
0055 GError **error);
0056 GLIB_AVAILABLE_IN_2_70
0057 GThreadPool * g_thread_pool_new_full (GFunc func,
0058 gpointer user_data,
0059 GDestroyNotify item_free_func,
0060 gint max_threads,
0061 gboolean exclusive,
0062 GError **error);
0063 GLIB_AVAILABLE_IN_ALL
0064 void g_thread_pool_free (GThreadPool *pool,
0065 gboolean immediate,
0066 gboolean wait_);
0067 GLIB_AVAILABLE_IN_ALL
0068 gboolean g_thread_pool_push (GThreadPool *pool,
0069 gpointer data,
0070 GError **error);
0071 GLIB_AVAILABLE_IN_ALL
0072 guint g_thread_pool_unprocessed (GThreadPool *pool);
0073 GLIB_AVAILABLE_IN_ALL
0074 void g_thread_pool_set_sort_function (GThreadPool *pool,
0075 GCompareDataFunc func,
0076 gpointer user_data);
0077 GLIB_AVAILABLE_IN_2_46
0078 gboolean g_thread_pool_move_to_front (GThreadPool *pool,
0079 gpointer data);
0080
0081 GLIB_AVAILABLE_IN_ALL
0082 gboolean g_thread_pool_set_max_threads (GThreadPool *pool,
0083 gint max_threads,
0084 GError **error);
0085 GLIB_AVAILABLE_IN_ALL
0086 gint g_thread_pool_get_max_threads (GThreadPool *pool);
0087 GLIB_AVAILABLE_IN_ALL
0088 guint g_thread_pool_get_num_threads (GThreadPool *pool);
0089
0090 GLIB_AVAILABLE_IN_ALL
0091 void g_thread_pool_set_max_unused_threads (gint max_threads);
0092 GLIB_AVAILABLE_IN_ALL
0093 gint g_thread_pool_get_max_unused_threads (void);
0094 GLIB_AVAILABLE_IN_ALL
0095 guint g_thread_pool_get_num_unused_threads (void);
0096 GLIB_AVAILABLE_IN_ALL
0097 void g_thread_pool_stop_unused_threads (void);
0098 GLIB_AVAILABLE_IN_ALL
0099 void g_thread_pool_set_max_idle_time (guint interval);
0100 GLIB_AVAILABLE_IN_ALL
0101 guint g_thread_pool_get_max_idle_time (void);
0102
0103 G_END_DECLS
0104
0105 #endif