From 424b7e92fce7a1af2c8b3f4d4a9bbd36eecf8891 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 15 Dec 2002 02:19:06 +0000 Subject: [PATCH] Mark the contents of the strucures in this file /*< private >*/ Sat Dec 14 21:10:57 2002 Owen Taylor * glib/gthread.h: Mark the contents of the strucures in this file /*< private >*/ * glib/gthread.[ch]: Rename the 'write' field of the structure to 'have_writer' to avoid any possible conflict with system headers. (#90549, Morten Welinder) --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-12 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ glib/gthread.c | 14 +++++++------- glib/gthread.h | 6 +++++- 9 files changed, 75 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f91117c..87ea79a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Dec 14 21:10:57 2002 Owen Taylor + + * glib/gthread.h: Mark the contents of the strucures + in this file /*< private >*/ + + * glib/gthread.[ch]: Rename the 'write' field of the + structure to 'have_writer' to avoid any possible + conflict with system headers. (#90549, Morten Welinder) + Sat Dec 14 20:11:41 2002 Owen Taylor * glib/libcharset/{localcharset.[ch] libcharset-glib.patch} diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f91117c..87ea79a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Sat Dec 14 21:10:57 2002 Owen Taylor + + * glib/gthread.h: Mark the contents of the strucures + in this file /*< private >*/ + + * glib/gthread.[ch]: Rename the 'write' field of the + structure to 'have_writer' to avoid any possible + conflict with system headers. (#90549, Morten Welinder) + Sat Dec 14 20:11:41 2002 Owen Taylor * glib/libcharset/{localcharset.[ch] libcharset-glib.patch} diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index f91117c..87ea79a 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,12 @@ +Sat Dec 14 21:10:57 2002 Owen Taylor + + * glib/gthread.h: Mark the contents of the strucures + in this file /*< private >*/ + + * glib/gthread.[ch]: Rename the 'write' field of the + structure to 'have_writer' to avoid any possible + conflict with system headers. (#90549, Morten Welinder) + Sat Dec 14 20:11:41 2002 Owen Taylor * glib/libcharset/{localcharset.[ch] libcharset-glib.patch} diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f91117c..87ea79a 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Sat Dec 14 21:10:57 2002 Owen Taylor + + * glib/gthread.h: Mark the contents of the strucures + in this file /*< private >*/ + + * glib/gthread.[ch]: Rename the 'write' field of the + structure to 'have_writer' to avoid any possible + conflict with system headers. (#90549, Morten Welinder) + Sat Dec 14 20:11:41 2002 Owen Taylor * glib/libcharset/{localcharset.[ch] libcharset-glib.patch} diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f91117c..87ea79a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Sat Dec 14 21:10:57 2002 Owen Taylor + + * glib/gthread.h: Mark the contents of the strucures + in this file /*< private >*/ + + * glib/gthread.[ch]: Rename the 'write' field of the + structure to 'have_writer' to avoid any possible + conflict with system headers. (#90549, Morten Welinder) + Sat Dec 14 20:11:41 2002 Owen Taylor * glib/libcharset/{localcharset.[ch] libcharset-glib.patch} diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f91117c..87ea79a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Sat Dec 14 21:10:57 2002 Owen Taylor + + * glib/gthread.h: Mark the contents of the strucures + in this file /*< private >*/ + + * glib/gthread.[ch]: Rename the 'write' field of the + structure to 'have_writer' to avoid any possible + conflict with system headers. (#90549, Morten Welinder) + Sat Dec 14 20:11:41 2002 Owen Taylor * glib/libcharset/{localcharset.[ch] libcharset-glib.patch} diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f91117c..87ea79a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Sat Dec 14 21:10:57 2002 Owen Taylor + + * glib/gthread.h: Mark the contents of the strucures + in this file /*< private >*/ + + * glib/gthread.[ch]: Rename the 'write' field of the + structure to 'have_writer' to avoid any possible + conflict with system headers. (#90549, Morten Welinder) + Sat Dec 14 20:11:41 2002 Owen Taylor * glib/libcharset/{localcharset.[ch] libcharset-glib.patch} diff --git a/glib/gthread.c b/glib/gthread.c index 149781e..34d1681 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -726,7 +726,7 @@ g_static_rw_lock_reader_lock (GStaticRWLock* lock) g_static_mutex_lock (&lock->mutex); lock->want_to_read++; - while (lock->write || lock->want_to_write) + while (lock->have_writer || lock->want_to_write) g_static_rw_lock_wait (&lock->read_cond, &lock->mutex); lock->want_to_read--; lock->read_counter++; @@ -744,7 +744,7 @@ g_static_rw_lock_reader_trylock (GStaticRWLock* lock) return TRUE; g_static_mutex_lock (&lock->mutex); - if (!lock->write && !lock->want_to_write) + if (!lock->have_writer && !lock->want_to_write) { lock->read_counter++; ret_val = TRUE; @@ -778,10 +778,10 @@ g_static_rw_lock_writer_lock (GStaticRWLock* lock) g_static_mutex_lock (&lock->mutex); lock->want_to_write++; - while (lock->write || lock->read_counter) + while (lock->have_writer || lock->read_counter) g_static_rw_lock_wait (&lock->write_cond, &lock->mutex); lock->want_to_write--; - lock->write = TRUE; + lock->have_writer = TRUE; g_static_mutex_unlock (&lock->mutex); } @@ -796,9 +796,9 @@ g_static_rw_lock_writer_trylock (GStaticRWLock* lock) return TRUE; g_static_mutex_lock (&lock->mutex); - if (!lock->write && !lock->read_counter) + if (!lock->have_writer && !lock->read_counter) { - lock->write = TRUE; + lock->have_writer = TRUE; ret_val = TRUE; } g_static_mutex_unlock (&lock->mutex); @@ -814,7 +814,7 @@ g_static_rw_lock_writer_unlock (GStaticRWLock* lock) return; g_static_mutex_lock (&lock->mutex); - lock->write = FALSE; + lock->have_writer = FALSE; g_static_rw_lock_signal (lock); g_static_mutex_unlock (&lock->mutex); } diff --git a/glib/gthread.h b/glib/gthread.h index 1ca5aa6..3152203 100644 --- a/glib/gthread.h +++ b/glib/gthread.h @@ -56,6 +56,7 @@ typedef enum typedef struct _GThread GThread; struct _GThread { + /*< private >*/ GThreadFunc func; gpointer data; gboolean joinable; @@ -229,6 +230,7 @@ void g_static_mutex_free (GStaticMutex *mutex); struct _GStaticPrivate { + /*< private >*/ guint index; }; #define G_STATIC_PRIVATE_INIT { 0 } @@ -242,6 +244,7 @@ void g_static_private_free (GStaticPrivate *private_key); typedef struct _GStaticRecMutex GStaticRecMutex; struct _GStaticRecMutex { + /*< private >*/ GStaticMutex mutex; guint depth; GSystemThread owner; @@ -260,11 +263,12 @@ void g_static_rec_mutex_free (GStaticRecMutex *mutex); typedef struct _GStaticRWLock GStaticRWLock; struct _GStaticRWLock { + /*< private >*/ GStaticMutex mutex; GCond *read_cond; GCond *write_cond; guint read_counter; - gboolean write; + gboolean have_writer; guint want_to_read; guint want_to_write; }; -- 2.7.4