File indexing completed on 2026-05-06 08:41:16
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_DEPRECATED_THREAD_H__
0028 #define __G_DEPRECATED_THREAD_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 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0039
0040 typedef enum
0041 {
0042 G_THREAD_PRIORITY_LOW,
0043 G_THREAD_PRIORITY_NORMAL,
0044 G_THREAD_PRIORITY_HIGH,
0045 G_THREAD_PRIORITY_URGENT
0046 } GThreadPriority GLIB_DEPRECATED_TYPE_IN_2_32;
0047
0048 struct _GThread
0049 {
0050
0051 GThreadFunc func;
0052 gpointer data;
0053 gboolean joinable;
0054 GThreadPriority priority;
0055 };
0056
0057 typedef struct _GThreadFunctions GThreadFunctions GLIB_DEPRECATED_TYPE_IN_2_32;
0058 struct _GThreadFunctions
0059 {
0060 GMutex* (*mutex_new) (void);
0061 void (*mutex_lock) (GMutex *mutex);
0062 gboolean (*mutex_trylock) (GMutex *mutex);
0063 void (*mutex_unlock) (GMutex *mutex);
0064 void (*mutex_free) (GMutex *mutex);
0065 GCond* (*cond_new) (void);
0066 void (*cond_signal) (GCond *cond);
0067 void (*cond_broadcast) (GCond *cond);
0068 void (*cond_wait) (GCond *cond,
0069 GMutex *mutex);
0070 gboolean (*cond_timed_wait) (GCond *cond,
0071 GMutex *mutex,
0072 GTimeVal *end_time);
0073 void (*cond_free) (GCond *cond);
0074 GPrivate* (*private_new) (GDestroyNotify destructor);
0075 gpointer (*private_get) (GPrivate *private_key);
0076 void (*private_set) (GPrivate *private_key,
0077 gpointer data);
0078 void (*thread_create) (GThreadFunc func,
0079 gpointer data,
0080 gulong stack_size,
0081 gboolean joinable,
0082 gboolean bound,
0083 GThreadPriority priority,
0084 gpointer thread,
0085 GError **error);
0086 void (*thread_yield) (void);
0087 void (*thread_join) (gpointer thread);
0088 void (*thread_exit) (void);
0089 void (*thread_set_priority)(gpointer thread,
0090 GThreadPriority priority);
0091 void (*thread_self) (gpointer thread);
0092 gboolean (*thread_equal) (gpointer thread1,
0093 gpointer thread2);
0094 } GLIB_DEPRECATED_TYPE_IN_2_32;
0095
0096 GLIB_VAR GThreadFunctions g_thread_functions_for_glib_use;
0097 GLIB_VAR gboolean g_thread_use_default_impl;
0098
0099 GLIB_VAR guint64 (*g_thread_gettime) (void);
0100
0101 GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
0102 GThread *g_thread_create (GThreadFunc func,
0103 gpointer data,
0104 gboolean joinable,
0105 GError **error);
0106
0107 GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
0108 GThread *g_thread_create_full (GThreadFunc func,
0109 gpointer data,
0110 gulong stack_size,
0111 gboolean joinable,
0112 gboolean bound,
0113 GThreadPriority priority,
0114 GError **error);
0115
0116 GLIB_DEPRECATED_IN_2_32
0117 void g_thread_set_priority (GThread *thread,
0118 GThreadPriority priority);
0119
0120 GLIB_DEPRECATED_IN_2_32
0121 void g_thread_foreach (GFunc thread_func,
0122 gpointer user_data);
0123
0124 #ifndef G_OS_WIN32
0125 #include <sys/types.h>
0126 #include <pthread.h>
0127 #endif
0128
0129 #define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl GLIB_DEPRECATED_MACRO_IN_2_32
0130 #ifndef G_OS_WIN32
0131 #define G_STATIC_MUTEX_INIT { NULL, PTHREAD_MUTEX_INITIALIZER } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init)
0132 #else
0133 #define G_STATIC_MUTEX_INIT { NULL } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init)
0134 #endif
0135 typedef struct
0136 {
0137 GMutex *mutex;
0138 #ifndef __GI_SCANNER__
0139 # ifndef G_OS_WIN32
0140
0141 pthread_mutex_t unused;
0142 # endif
0143 #endif
0144 } GStaticMutex GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GMutex);
0145
0146 #define g_static_mutex_lock(mutex) \
0147 g_mutex_lock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_lock)
0148 #define g_static_mutex_trylock(mutex) \
0149 g_mutex_trylock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_trylock)
0150 #define g_static_mutex_unlock(mutex) \
0151 g_mutex_unlock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_unlock)
0152
0153 GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_init)
0154 void g_static_mutex_init (GStaticMutex *mutex);
0155 GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_clear)
0156 void g_static_mutex_free (GStaticMutex *mutex);
0157 GLIB_DEPRECATED_IN_2_32_FOR(GMutex)
0158 GMutex *g_static_mutex_get_mutex_impl (GStaticMutex *mutex);
0159
0160 typedef struct _GStaticRecMutex GStaticRecMutex GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRecMutex);
0161 struct _GStaticRecMutex
0162 {
0163
0164 GStaticMutex mutex;
0165 guint depth;
0166
0167 #ifndef __GI_SCANNER__
0168
0169 union {
0170 # ifdef G_OS_WIN32
0171 void *owner;
0172 # else
0173 pthread_t owner;
0174 # endif
0175 gdouble dummy;
0176 } unused;
0177 #endif
0178 } GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRecMutex);
0179
0180 #define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rec_mutex_init)
0181 GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init)
0182 void g_static_rec_mutex_init (GStaticRecMutex *mutex);
0183
0184 GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_lock)
0185 void g_static_rec_mutex_lock (GStaticRecMutex *mutex);
0186
0187 GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_try_lock)
0188 gboolean g_static_rec_mutex_trylock (GStaticRecMutex *mutex);
0189
0190 GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_unlock)
0191 void g_static_rec_mutex_unlock (GStaticRecMutex *mutex);
0192
0193 GLIB_DEPRECATED_IN_2_32
0194 void g_static_rec_mutex_lock_full (GStaticRecMutex *mutex,
0195 guint depth);
0196
0197 GLIB_DEPRECATED_IN_2_32
0198 guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex);
0199
0200 GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_free)
0201 void g_static_rec_mutex_free (GStaticRecMutex *mutex);
0202
0203 typedef struct _GStaticRWLock GStaticRWLock GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRWLock);
0204 struct _GStaticRWLock
0205 {
0206
0207 GStaticMutex mutex;
0208 GCond *read_cond;
0209 GCond *write_cond;
0210 guint read_counter;
0211 gboolean have_writer;
0212 guint want_to_read;
0213 guint want_to_write;
0214 } GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRWLock);
0215
0216 #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)
0217
0218 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_init)
0219 void g_static_rw_lock_init (GStaticRWLock *lock);
0220
0221 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_lock)
0222 void g_static_rw_lock_reader_lock (GStaticRWLock *lock);
0223
0224 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_trylock)
0225 gboolean g_static_rw_lock_reader_trylock (GStaticRWLock *lock);
0226
0227 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_unlock)
0228 void g_static_rw_lock_reader_unlock (GStaticRWLock *lock);
0229
0230 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_lock)
0231 void g_static_rw_lock_writer_lock (GStaticRWLock *lock);
0232
0233 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_trylock)
0234 gboolean g_static_rw_lock_writer_trylock (GStaticRWLock *lock);
0235
0236 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_unlock)
0237 void g_static_rw_lock_writer_unlock (GStaticRWLock *lock);
0238
0239 GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_free)
0240 void g_static_rw_lock_free (GStaticRWLock *lock);
0241
0242 GLIB_DEPRECATED_IN_2_32
0243 GPrivate * g_private_new (GDestroyNotify notify);
0244
0245 typedef struct _GStaticPrivate GStaticPrivate GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GPrivate);
0246 struct _GStaticPrivate
0247 {
0248
0249 guint index;
0250 } GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GPrivate);
0251
0252 #define G_STATIC_PRIVATE_INIT { 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(G_PRIVATE_INIT)
0253 GLIB_DEPRECATED_IN_2_32
0254 void g_static_private_init (GStaticPrivate *private_key);
0255
0256 GLIB_DEPRECATED_IN_2_32_FOR(g_private_get)
0257 gpointer g_static_private_get (GStaticPrivate *private_key);
0258
0259 GLIB_DEPRECATED_IN_2_32_FOR(g_private_set)
0260 void g_static_private_set (GStaticPrivate *private_key,
0261 gpointer data,
0262 GDestroyNotify notify);
0263
0264 GLIB_DEPRECATED_IN_2_32
0265 void g_static_private_free (GStaticPrivate *private_key);
0266
0267 GLIB_DEPRECATED_IN_2_32
0268 gboolean g_once_init_enter_impl (volatile gsize *location);
0269
0270 GLIB_DEPRECATED_IN_2_32
0271 void g_thread_init (gpointer vtable);
0272 GLIB_DEPRECATED_IN_2_32
0273 void g_thread_init_with_errorcheck_mutexes (gpointer vtable);
0274
0275 GLIB_DEPRECATED_IN_2_32
0276 gboolean g_thread_get_initialized (void);
0277
0278 GLIB_VAR gboolean g_threads_got_initialized;
0279
0280 #define g_thread_supported() (1) GLIB_DEPRECATED_MACRO_IN_2_32
0281
0282 GLIB_DEPRECATED_IN_2_32
0283 GMutex * g_mutex_new (void);
0284 GLIB_DEPRECATED_IN_2_32
0285 void g_mutex_free (GMutex *mutex);
0286 GLIB_DEPRECATED_IN_2_32
0287 GCond * g_cond_new (void);
0288 GLIB_DEPRECATED_IN_2_32
0289 void g_cond_free (GCond *cond);
0290 GLIB_DEPRECATED_IN_2_32
0291 gboolean g_cond_timed_wait (GCond *cond,
0292 GMutex *mutex,
0293 GTimeVal *abs_time);
0294
0295 G_GNUC_END_IGNORE_DEPRECATIONS
0296
0297 G_END_DECLS
0298
0299 #endif