* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
-#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
-#error "Only <glib.h> can be included directly."
-#endif
-
#ifndef __G_DEPRECATED_THREAD_H__
#define __G_DEPRECATED_THREAD_H__
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
#include <glib/gthread.h>
G_BEGIN_DECLS
+#ifndef G_DISABLE_DEPRECATED
+
typedef enum
{
G_THREAD_PRIORITY_LOW,
G_THREAD_PRIORITY_URGENT
} GThreadPriority;
+#endif
+
struct _GThread
{
/*< private >*/
GThreadPriority priority;
};
+#ifndef G_DISABLE_DEPRECATED
+
typedef struct _GThreadFunctions GThreadFunctions;
struct _GThreadFunctions
{
GLIB_VAR guint64 (*g_thread_gettime) (void);
-/* internal function for fallback static mutex implementation */
-GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
-
-GThread* g_thread_create (GThreadFunc func,
- gpointer data,
- gboolean joinable,
- GError **error);
-GThread* g_thread_create_full (GThreadFunc func,
- gpointer data,
- gulong stack_size,
- gboolean joinable,
- gboolean bound,
- GThreadPriority priority,
- GError **error);
-
-void g_thread_set_priority (GThread *thread,
- GThreadPriority priority);
-
-void g_thread_foreach (GFunc thread_func,
- gpointer user_data);
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
+GThread *g_thread_create (GThreadFunc func,
+ gpointer data,
+ gboolean joinable,
+ GError **error);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
+GThread *g_thread_create_full (GThreadFunc func,
+ gpointer data,
+ gulong stack_size,
+ gboolean joinable,
+ gboolean bound,
+ GThreadPriority priority,
+ GError **error);
+
+GLIB_DEPRECATED_IN_2_32
+void g_thread_set_priority (GThread *thread,
+ GThreadPriority priority);
+
+GLIB_DEPRECATED_IN_2_32
+void g_thread_foreach (GFunc thread_func,
+ gpointer user_data);
+
+#ifndef G_OS_WIN32
+#include <sys/types.h>
+#include <pthread.h>
+#endif
-#ifdef G_OS_WIN32
-typedef GMutex * GStaticMutex;
-#define G_STATIC_MUTEX_INIT NULL
#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl
-#else /* G_OS_WIN32 */
-typedef struct {
- GMutex *unused;
- GMutex mutex;
+#define G_STATIC_MUTEX_INIT { NULL }
+typedef struct
+{
+ GMutex *mutex;
+#ifndef G_OS_WIN32
+ /* only for ABI compatibility reasons */
+ pthread_mutex_t unused;
+#endif
} GStaticMutex;
-#define G_STATIC_MUTEX_INIT { NULL, { NULL } }
-#define g_static_mutex_get_mutex(s) (&(s)->mutex)
-#endif /* G_OS_WIN32 */
#define g_static_mutex_lock(mutex) \
g_mutex_lock (g_static_mutex_get_mutex (mutex))
g_mutex_trylock (g_static_mutex_get_mutex (mutex))
#define g_static_mutex_unlock(mutex) \
g_mutex_unlock (g_static_mutex_get_mutex (mutex))
-void g_static_mutex_init (GStaticMutex *mutex);
-void g_static_mutex_free (GStaticMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_init)
+void g_static_mutex_init (GStaticMutex *mutex);
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_clear)
+void g_static_mutex_free (GStaticMutex *mutex);
+GLIB_DEPRECATED_IN_2_32_FOR(GMutex)
+GMutex *g_static_mutex_get_mutex_impl (GStaticMutex *mutex);
typedef struct _GStaticRecMutex GStaticRecMutex;
struct _GStaticRecMutex
/*< private >*/
GStaticMutex mutex;
guint depth;
- GSystemThread owner;
+
+ /* ABI compat only */
+ union {
+#ifdef G_OS_WIN32
+ void *owner;
+#else
+ pthread_t owner;
+#endif
+ gdouble dummy;
+ } unused;
};
-#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, {{0, 0, 0, 0}} }
+#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT }
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init)
void g_static_rec_mutex_init (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_lock)
void g_static_rec_mutex_lock (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_try_lock)
gboolean g_static_rec_mutex_trylock (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_unlock)
void g_static_rec_mutex_unlock (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32
void g_static_rec_mutex_lock_full (GStaticRecMutex *mutex,
guint depth);
+
+GLIB_DEPRECATED_IN_2_32
guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_free)
void g_static_rec_mutex_free (GStaticRecMutex *mutex);
typedef struct _GStaticRWLock GStaticRWLock;
#define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 }
-void g_static_rw_lock_init (GStaticRWLock* lock);
-void g_static_rw_lock_reader_lock (GStaticRWLock* lock);
-gboolean g_static_rw_lock_reader_trylock (GStaticRWLock* lock);
-void g_static_rw_lock_reader_unlock (GStaticRWLock* lock);
-void g_static_rw_lock_writer_lock (GStaticRWLock* lock);
-gboolean g_static_rw_lock_writer_trylock (GStaticRWLock* lock);
-void g_static_rw_lock_writer_unlock (GStaticRWLock* lock);
-void g_static_rw_lock_free (GStaticRWLock* lock);
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_init)
+void g_static_rw_lock_init (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_lock)
+void g_static_rw_lock_reader_lock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_trylock)
+gboolean g_static_rw_lock_reader_trylock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_unlock)
+void g_static_rw_lock_reader_unlock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_lock)
+void g_static_rw_lock_writer_lock (GStaticRWLock *lock);
-GPrivate * g_private_new (GDestroyNotify notify);
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_trylock)
+gboolean g_static_rw_lock_writer_trylock (GStaticRWLock *lock);
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_unlock)
+void g_static_rw_lock_writer_unlock (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_free)
+void g_static_rw_lock_free (GStaticRWLock *lock);
+
+GLIB_DEPRECATED_IN_2_32
+GPrivate * g_private_new (GDestroyNotify notify);
+
+typedef struct _GStaticPrivate GStaticPrivate;
struct _GStaticPrivate
{
/*< private >*/
};
#define G_STATIC_PRIVATE_INIT { 0 }
-void g_static_private_init (GStaticPrivate *private_key);
-gpointer g_static_private_get (GStaticPrivate *private_key);
-void g_static_private_set (GStaticPrivate *private_key,
- gpointer data,
- GDestroyNotify notify);
-void g_static_private_free (GStaticPrivate *private_key);
+GLIB_DEPRECATED_IN_2_32
+void g_static_private_init (GStaticPrivate *private_key);
-gboolean g_once_init_enter_impl (volatile gsize *location);
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_get)
+gpointer g_static_private_get (GStaticPrivate *private_key);
-void g_thread_init (gpointer vtable);
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_set)
+void g_static_private_set (GStaticPrivate *private_key,
+ gpointer data,
+ GDestroyNotify notify);
-gboolean g_thread_get_initialized (void);
+GLIB_DEPRECATED_IN_2_32
+void g_static_private_free (GStaticPrivate *private_key);
-GLIB_VAR gboolean g_threads_got_initialized;
+GLIB_DEPRECATED_IN_2_32
+gboolean g_once_init_enter_impl (volatile gsize *location);
-#if defined(G_THREADS_MANDATORY)
-#define g_thread_supported() 1
-#else
-#define g_thread_supported() (g_threads_got_initialized)
-#endif
+GLIB_DEPRECATED_IN_2_32
+void g_thread_init (gpointer vtable);
+GLIB_DEPRECATED_IN_2_32
+void g_thread_init_with_errorcheck_mutexes (gpointer vtable);
+
+GLIB_DEPRECATED_IN_2_32
+gboolean g_thread_get_initialized (void);
-GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
+GLIB_VAR gboolean g_threads_got_initialized;
-GMutex * g_mutex_new (void);
-void g_mutex_free (GMutex *mutex);
-GCond * g_cond_new (void);
-void g_cond_free (GCond *cond);
+#define g_thread_supported() (1)
+
+GLIB_DEPRECATED_IN_2_32
+GMutex * g_mutex_new (void);
+GLIB_DEPRECATED_IN_2_32
+void g_mutex_free (GMutex *mutex);
+GLIB_DEPRECATED_IN_2_32
+GCond * g_cond_new (void);
+GLIB_DEPRECATED_IN_2_32
+void g_cond_free (GCond *cond);
+GLIB_DEPRECATED_IN_2_32
+gboolean g_cond_timed_wait (GCond *cond,
+ GMutex *mutex,
+ GTimeVal *timeval);
+
+#endif
G_END_DECLS