Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-06 08:41:19

0001 /* GLIB - Library of useful routines for C programming
0002  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public
0017  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 /*
0021  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
0022  * file for a list of people on the GLib Team.  See the ChangeLog
0023  * files for a list of changes.  These files are distributed with
0024  * GLib at ftp://ftp.gtk.org/pub/gtk/.
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 /* Thread Pools
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 /* __G_THREADPOOL_H__ */