Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
deprecated/gthread.h
Go to the documentation of this file.
1/* GLIB - Library of useful routines for C programming
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20/*
21 * Modified by the GLib Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GLib Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GLib at ftp://ftp.gtk.org/pub/gtk/.
25 */
26
27#ifndef __G_DEPRECATED_THREAD_H__
28#define __G_DEPRECATED_THREAD_H__
29
30#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
31#error "Only <glib.h> can be included directly."
32#endif
33
34#include <glib/gthread.h>
35
37
39
47
56
57typedef struct _GThreadFunctions GThreadFunctions GLIB_DEPRECATED_TYPE_IN_2_32;
59{
60 GMutex* (*mutex_new) (void);
65 GCond* (*cond_new) (void);
68 void (*cond_wait) (GCond *cond,
69 GMutex *mutex);
72 GTimeVal *end_time);
73 void (*cond_free) (GCond *cond);
74 GPrivate* (*private_new) (GDestroyNotify destructor);
75 gpointer (*private_get) (GPrivate *private_key);
76 void (*private_set) (GPrivate *private_key,
77 gpointer data);
79 gpointer data,
80 gulong stack_size,
81 gboolean joinable,
82 gboolean bound,
84 gpointer thread,
85 GError **error);
86 void (*thread_yield) (void);
87 void (*thread_join) (gpointer thread);
88 void (*thread_exit) (void);
91 void (*thread_self) (gpointer thread);
93 gpointer thread2);
95
98
100
103 gpointer data,
104 gboolean joinable,
105 GError **error);
106
109 gpointer data,
110 gulong stack_size,
111 gboolean joinable,
112 gboolean bound,
114 GError **error);
115
119
121void g_thread_foreach (GFunc thread_func,
122 gpointer user_data);
123
124#ifndef G_OS_WIN32
125#include <sys/types.h>
126#include <pthread.h>
127#endif
128
129#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl GLIB_DEPRECATED_MACRO_IN_2_32
130#ifndef G_OS_WIN32
131#define G_STATIC_MUTEX_INIT { NULL, PTHREAD_MUTEX_INITIALIZER } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init)
132#else
133#define G_STATIC_MUTEX_INIT { NULL } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init)
134#endif
135typedef struct
136{
138#ifndef __GI_SCANNER__
139# ifndef G_OS_WIN32
140 /* only for ABI compatibility reasons */
141 pthread_mutex_t unused;
142# endif /* !G_OS_WIN32 */
143#endif /* !__GI_SCANNER__ */
145
146#define g_static_mutex_lock(mutex) \
147 g_mutex_lock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_lock)
148#define g_static_mutex_trylock(mutex) \
149 g_mutex_trylock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_trylock)
150#define g_static_mutex_unlock(mutex) \
151 g_mutex_unlock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_unlock)
152
159
162{
163 /*< private >*/
166
167#ifndef __GI_SCANNER__
168 /* ABI compat only */
169 union {
170# ifdef G_OS_WIN32
171 void *owner;
172# else
173 pthread_t owner;
174# endif /* !G_OS_WIN32 */
177#endif /* !__GI_SCANNER__ */
179
180#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rec_mutex_init)
182void g_static_rec_mutex_init (GStaticRecMutex *mutex);
183
185void g_static_rec_mutex_lock (GStaticRecMutex *mutex);
186
187GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_try_lock)
189
191void g_static_rec_mutex_unlock (GStaticRecMutex *mutex);
192
194void g_static_rec_mutex_lock_full (GStaticRecMutex *mutex,
195 guint depth);
196
199
200GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_free)
201void g_static_rec_mutex_free (GStaticRecMutex *mutex);
202
215
216#define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rw_lock_init)
217
219void g_static_rw_lock_init (GStaticRWLock *lock);
220
222void g_static_rw_lock_reader_lock (GStaticRWLock *lock);
223
226
228void g_static_rw_lock_reader_unlock (GStaticRWLock *lock);
229
231void g_static_rw_lock_writer_lock (GStaticRWLock *lock);
232
235
237void g_static_rw_lock_writer_unlock (GStaticRWLock *lock);
238
239GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_free)
240void g_static_rw_lock_free (GStaticRWLock *lock);
241
244
251
252#define G_STATIC_PRIVATE_INIT { 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(G_PRIVATE_INIT)
254void g_static_private_init (GStaticPrivate *private_key);
255
257gpointer g_static_private_get (GStaticPrivate *private_key);
258
260void g_static_private_set (GStaticPrivate *private_key,
261 gpointer data,
262 GDestroyNotify notify);
263
265void g_static_private_free (GStaticPrivate *private_key);
266
269
274
277
279
280#define g_thread_supported() (1) GLIB_DEPRECATED_MACRO_IN_2_32
281
292 GMutex *mutex,
293 GTimeVal *abs_time);
294
296
298
299#endif /* __G_DEPRECATED_THREAD_H__ */
GLIB_VAR gboolean g_threads_got_initialized
GLIB_DEPRECATED_IN_2_32 void g_static_rec_mutex_lock_full(GStaticRecMutex *mutex, guint depth)
void g_static_rw_lock_reader_unlock(GStaticRWLock *lock)
GLIB_VAR guint64(* g_thread_gettime)(void)
GLIB_DEPRECATED_IN_2_32 void g_mutex_free(GMutex *mutex)
GLIB_DEPRECATED_IN_2_32 gboolean g_cond_timed_wait(GCond *cond, GMutex *mutex, GTimeVal *abs_time)
GLIB_DEPRECATED_IN_2_32 void g_static_private_init(GStaticPrivate *private_key)
struct _GThreadFunctions GThreadFunctions GLIB_DEPRECATED_TYPE_IN_2_32
guint depth
GLIB_DEPRECATED_IN_2_32 void g_static_private_free(GStaticPrivate *private_key)
GStaticMutex mutex
GThread * g_thread_create_full(GThreadFunc func, gpointer data, gulong stack_size, gboolean joinable, gboolean bound, GThreadPriority priority, GError **error)
GMutex * g_static_mutex_get_mutex_impl(GStaticMutex *mutex)
void g_static_private_set(GStaticPrivate *private_key, gpointer data, GDestroyNotify notify)
GLIB_DEPRECATED_IN_2_32 gboolean g_once_init_enter_impl(volatile gsize *location)
void g_static_rw_lock_free(GStaticRWLock *lock)
void g_static_rec_mutex_init(GStaticRecMutex *mutex)
GLIB_DEPRECATED_IN_2_32 guint g_static_rec_mutex_unlock_full(GStaticRecMutex *mutex)
GLIB_DEPRECATED_IN_2_32 void g_thread_init_with_errorcheck_mutexes(gpointer vtable)
GLIB_DEPRECATED_IN_2_32 GMutex * g_mutex_new(void)
GLIB_DEPRECATED_IN_2_32 gboolean g_thread_get_initialized(void)
gboolean g_static_rw_lock_reader_trylock(GStaticRWLock *lock)
void g_static_rw_lock_reader_lock(GStaticRWLock *lock)
gboolean g_static_rec_mutex_trylock(GStaticRecMutex *mutex)
GLIB_VAR GThreadFunctions g_thread_functions_for_glib_use
void g_static_rw_lock_writer_lock(GStaticRWLock *lock)
GLIB_DEPRECATED_IN_2_32 GPrivate * g_private_new(GDestroyNotify notify)
gpointer g_static_private_get(GStaticPrivate *private_key)
void g_static_rec_mutex_unlock(GStaticRecMutex *mutex)
void g_static_rw_lock_writer_unlock(GStaticRWLock *lock)
GLIB_DEPRECATED_IN_2_32 void g_thread_init(gpointer vtable)
gboolean g_static_rw_lock_writer_trylock(GStaticRWLock *lock)
GLIB_DEPRECATED_IN_2_32 void g_cond_free(GCond *cond)
GLIB_DEPRECATED_IN_2_32 void g_thread_foreach(GFunc thread_func, gpointer user_data)
void g_static_rw_lock_init(GStaticRWLock *lock)
GLIB_DEPRECATED_IN_2_32 GCond * g_cond_new(void)
union @139 unused
GLIB_DEPRECATED_IN_2_32 void g_thread_set_priority(GThread *thread, GThreadPriority priority)
pthread_t owner
void g_static_rec_mutex_free(GStaticRecMutex *mutex)
GThreadPriority
@ G_THREAD_PRIORITY_URGENT
@ G_THREAD_PRIORITY_HIGH
@ G_THREAD_PRIORITY_NORMAL
@ G_THREAD_PRIORITY_LOW
void g_static_mutex_free(GStaticMutex *mutex)
void g_static_rec_mutex_lock(GStaticRecMutex *mutex)
GLIB_VAR gboolean g_thread_use_default_impl
void g_static_mutex_init(GStaticMutex *mutex)
GThread * g_thread_create(GThreadFunc func, gpointer data, gboolean joinable, GError **error)
#define GLIB_DEPRECATED_IN_2_32
#define GLIB_DEPRECATED_IN_2_32_FOR(f)
#define GLIB_VAR
#define GLIB_DEPRECATED_TYPE_IN_2_32_FOR(f)
unsigned long guint64
Definition glibconfig.h:67
unsigned long gsize
Definition glibconfig.h:83
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Definition gmacros.h:771
#define G_GNUC_END_IGNORE_DEPRECATIONS
Definition gmacros.h:772
GLIB_AVAILABLE_IN_2_32 void g_rec_mutex_unlock(GRecMutex *rec_mutex)
GLIB_AVAILABLE_IN_2_32 void g_mutex_init(GMutex *mutex)
GLIB_AVAILABLE_IN_2_32 void g_rec_mutex_lock(GRecMutex *rec_mutex)
GLIB_AVAILABLE_IN_2_32 void g_rw_lock_init(GRWLock *rw_lock)
GLIB_AVAILABLE_IN_2_32 void g_rw_lock_reader_lock(GRWLock *rw_lock)
GLIB_AVAILABLE_IN_2_32 void g_rw_lock_writer_lock(GRWLock *rw_lock)
gpointer(* GThreadFunc)(gpointer data)
Definition gthread.h:49
GLIB_AVAILABLE_IN_2_32 void g_mutex_clear(GMutex *mutex)
GLIB_AVAILABLE_IN_2_32 gboolean g_rw_lock_writer_trylock(GRWLock *rw_lock)
GLIB_AVAILABLE_IN_2_32 void g_rw_lock_reader_unlock(GRWLock *rw_lock)
GLIB_AVAILABLE_IN_ALL void g_private_set(GPrivate *key, gpointer value)
GLIB_AVAILABLE_IN_2_32 void g_rec_mutex_init(GRecMutex *rec_mutex)
GLIB_AVAILABLE_IN_ALL gpointer g_private_get(GPrivate *key)
GLIB_AVAILABLE_IN_2_32 void g_rw_lock_writer_unlock(GRWLock *rw_lock)
GLIB_AVAILABLE_IN_2_32 gboolean g_rw_lock_reader_trylock(GRWLock *rw_lock)
GLIB_AVAILABLE_IN_2_32 GThread * g_thread_new(const gchar *name, GThreadFunc func, gpointer data)
gint gboolean
Definition gtypes.h:56
unsigned long gulong
Definition gtypes.h:60
void * gpointer
Definition gtypes.h:109
double gdouble
Definition gtypes.h:64
void(* GFunc)(gpointer data, gpointer user_data)
Definition gtypes.h:141
void(* GDestroyNotify)(gpointer data)
Definition gtypes.h:140
unsigned int guint
Definition gtypes.h:61
static int cond(LexState *ls)
static const struct @51 priority[]
static void error(LoadState *S, const char *why)
pthread_mutex_t unused
void(* mutex_lock)(GMutex *mutex)
gboolean(* mutex_trylock)(GMutex *mutex)
gpointer(* private_get)(GPrivate *private_key)
void(* thread_exit)(void)
void(* thread_create)(GThreadFunc func, gpointer data, gulong stack_size, gboolean joinable, gboolean bound, GThreadPriority priority, gpointer thread, GError **error)
gboolean(* cond_timed_wait)(GCond *cond, GMutex *mutex, GTimeVal *end_time)
void(* mutex_unlock)(GMutex *mutex)
void(* thread_yield)(void)
void(* cond_free)(GCond *cond)
void(* cond_broadcast)(GCond *cond)
void(* cond_wait)(GCond *cond, GMutex *mutex)
void(* mutex_free)(GMutex *mutex)
gboolean(* thread_equal)(gpointer thread1, gpointer thread2)
void(* thread_set_priority)(gpointer thread, GThreadPriority priority)
void(* cond_signal)(GCond *cond)
void(* private_set)(GPrivate *private_key, gpointer data)
void(* thread_join)(gpointer thread)
void(* thread_self)(gpointer thread)
GThreadPriority priority
GThreadFunc func
gboolean joinable