Changed signature of all g_static_mutex_* functions to take a pointer

1999-02-15  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, glibconfig.h.win32, configure.in: Changed signature of
	all g_static_mutex_* functions to take a pointer rather than the
	struct itself. This is not an issue at the moment, because those
	funcs are really macros, but is it un'G'ish and might fall on our
	feet in the future.

	* gthread/testgthread.c (test_mutexes): Use new signature of
	g_static_mutex* functions.
This commit is contained in:
Sebastian Wilhelmi 1999-02-15 08:26:00 +00:00 committed by Sebastian Wilhelmi
parent 3f5639a791
commit 8168836cd2
14 changed files with 88 additions and 19 deletions

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -1,3 +1,11 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, glibconfig.h.win32, configure.in: Changed signature of
all g_static_mutex_* functions to take a pointer rather than the
struct itself. This is not an issue at the moment, because those
funcs are really macros, but is it un'G'ish and might fall on our
feet in the future.
Mon Feb 15 07:45:54 1999 Tim Janik <timj@gtk.org>
* configure.in (--enable-debug): default to yes for development trees.

View File

@ -995,8 +995,8 @@ struct _GStaticMutex
};
#define G_STATIC_MUTEX_INIT { NULL, { { $g_mutex_contents} } }
#define g_static_mutex_get_mutex(mutex) \
(g_thread_use_default_impl ? ((GMutex*) &(mutex).aligned_pad_u) : \
g_static_mutex_get_mutex_impl (&(mutex).runtime_mutex))
(g_thread_use_default_impl ? ((GMutex*) &((mutex)->aligned_pad_u)) : \
g_static_mutex_get_mutex_impl (&((mutex)->runtime_mutex)))
_______EOF
else
cat >>$outfile <<_______EOF
@ -1004,7 +1004,7 @@ $g_enable_threads_def G_THREADS_ENABLED
#define G_THREADS_IMPL_$g_threads_impl_def
typedef struct _GMutex* GStaticMutex;
#define G_STATIC_MUTEX_INIT NULL
#define g_static_mutex_get_mutex(mutex) (g_static_mutex_get_mutex_impl (&(mutex)))
#define g_static_mutex_get_mutex(mutex) (g_static_mutex_get_mutex_impl (mutex))
_______EOF
fi

12
glib.h
View File

@ -2741,25 +2741,25 @@ extern void glib_dummy_decl (void);
"file %s: line %d (%s): locking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
g_static_mutex_lock (G_LOCK_NAME (name)); \
g_static_mutex_lock (&G_LOCK_NAME (name)); \
}G_STMT_END
# define G_UNLOCK(name) G_STMT_START{ \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"file %s: line %d (%s): unlocking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
g_static_mutex_unlock (G_LOCK_NAME (name)); \
g_static_mutex_unlock (&G_LOCK_NAME (name)); \
}G_STMT_END
# define G_TRYLOCK(name) G_STMT_START{ \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"file %s: line %d (%s): try locking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
}G_STMT_END, g_static_mutex_trylock (G_LOCK_NAME (name))
}G_STMT_END, g_static_mutex_trylock (&G_LOCK_NAME (name))
# else /* !G_DEBUG_LOCKS */
# define G_LOCK(name) g_static_mutex_lock (G_LOCK_NAME (name))
# define G_UNLOCK(name) g_static_mutex_unlock (G_LOCK_NAME (name))
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# define G_LOCK(name) g_static_mutex_lock (&G_LOCK_NAME (name))
# define G_UNLOCK(name) g_static_mutex_unlock (&G_LOCK_NAME (name))
# define G_TRYLOCK(name) g_static_mutex_trylock (&G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
# define G_LOCK_DEFINE_STATIC(name) extern void glib_dummy_decl (void)

View File

@ -2741,25 +2741,25 @@ extern void glib_dummy_decl (void);
"file %s: line %d (%s): locking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
g_static_mutex_lock (G_LOCK_NAME (name)); \
g_static_mutex_lock (&G_LOCK_NAME (name)); \
}G_STMT_END
# define G_UNLOCK(name) G_STMT_START{ \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"file %s: line %d (%s): unlocking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
g_static_mutex_unlock (G_LOCK_NAME (name)); \
g_static_mutex_unlock (&G_LOCK_NAME (name)); \
}G_STMT_END
# define G_TRYLOCK(name) G_STMT_START{ \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
"file %s: line %d (%s): try locking: %s ", \
__FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, \
#name); \
}G_STMT_END, g_static_mutex_trylock (G_LOCK_NAME (name))
}G_STMT_END, g_static_mutex_trylock (&G_LOCK_NAME (name))
# else /* !G_DEBUG_LOCKS */
# define G_LOCK(name) g_static_mutex_lock (G_LOCK_NAME (name))
# define G_UNLOCK(name) g_static_mutex_unlock (G_LOCK_NAME (name))
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# define G_LOCK(name) g_static_mutex_lock (&G_LOCK_NAME (name))
# define G_UNLOCK(name) g_static_mutex_unlock (&G_LOCK_NAME (name))
# define G_TRYLOCK(name) g_static_mutex_trylock (&G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
# define G_LOCK_DEFINE_STATIC(name) extern void glib_dummy_decl (void)

View File

@ -120,8 +120,8 @@ struct _GStaticMutex
/* This should be NULL followed by the bytes in PTHREAD_MUTEX_INITIALIZER */
#define G_STATIC_MUTEX_INIT { NULL, { { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }
#define g_static_mutex_get_mutex(mutex) \
(g_thread_use_default_impl ? ((GMutex*) &(mutex).aligned_pad_u) : \
g_static_mutex_get_mutex_impl (&(mutex).runtime_mutex))
(g_thread_use_default_impl ? ((GMutex*) &((mutex)->aligned_pad_u)) : \
g_static_mutex_get_mutex_impl (&((mutex)->runtime_mutex)))
#define G_BYTE_ORDER G_LITTLE_ENDIAN

View File

@ -1,3 +1,8 @@
1999-02-15 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* testgthread.c (test_mutexes): Use new signature of
g_static_mutex* functions.
1999-02-08 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread-posix.c (g_private_get_posix_impl): Use the

View File

@ -26,8 +26,8 @@ test_mutexes (void)
g_mutex_lock (mutex);
g_mutex_unlock (mutex);
g_static_mutex_lock (static_mutex);
g_static_mutex_unlock (static_mutex);
g_static_mutex_lock (&static_mutex);
g_static_mutex_unlock (&static_mutex);
g_cond_signal (cond);
g_cond_broadcast (cond);