mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Broadcast the condition, if there are waiting readers, as all might read
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gthread.c: Broadcast the condition, if there are waiting readers, as all might read at the same time. Only signal the writer thread, if there are no more readers. * gthread/gthread-impl.c (g_mutex_free_errorcheck_impl): Add new check to errorcheck mutexes to abort, if a locked mutex is freed.
This commit is contained in:
parent
cd888afb5a
commit
c96ad49767
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -1,3 +1,9 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread.c: Broadcast the condition, if there are waiting
|
||||
readers, as all might read at the same time. Only signal the
|
||||
writer thread, if there are no more readers.
|
||||
|
||||
2001-01-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* makefile.mingw.in
|
||||
|
@ -517,7 +517,7 @@ static void inline g_static_rw_lock_signal (GStaticRWLock* lock)
|
||||
if (lock->want_to_write && lock->write_cond)
|
||||
g_cond_signal (lock->write_cond);
|
||||
else if (lock->read_cond)
|
||||
g_cond_signal (lock->read_cond);
|
||||
g_cond_broadcast (lock->read_cond);
|
||||
}
|
||||
|
||||
void g_static_rw_lock_reader_lock (GStaticRWLock* lock)
|
||||
@ -562,7 +562,8 @@ void g_static_rw_lock_reader_unlock (GStaticRWLock* lock)
|
||||
|
||||
g_static_mutex_lock (&lock->mutex);
|
||||
lock->read_counter--;
|
||||
g_static_rw_lock_signal (lock);
|
||||
if (lock->read_counter == 0)
|
||||
g_static_rw_lock_signal (lock);
|
||||
g_static_mutex_unlock (&lock->mutex);
|
||||
}
|
||||
|
||||
|
@ -517,7 +517,7 @@ static void inline g_static_rw_lock_signal (GStaticRWLock* lock)
|
||||
if (lock->want_to_write && lock->write_cond)
|
||||
g_cond_signal (lock->write_cond);
|
||||
else if (lock->read_cond)
|
||||
g_cond_signal (lock->read_cond);
|
||||
g_cond_broadcast (lock->read_cond);
|
||||
}
|
||||
|
||||
void g_static_rw_lock_reader_lock (GStaticRWLock* lock)
|
||||
@ -562,7 +562,8 @@ void g_static_rw_lock_reader_unlock (GStaticRWLock* lock)
|
||||
|
||||
g_static_mutex_lock (&lock->mutex);
|
||||
lock->read_counter--;
|
||||
g_static_rw_lock_signal (lock);
|
||||
if (lock->read_counter == 0)
|
||||
g_static_rw_lock_signal (lock);
|
||||
g_static_mutex_unlock (&lock->mutex);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2001-01-29 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread-impl.c (g_mutex_free_errorcheck_impl): Add new check to
|
||||
errorcheck mutexes to abort, if a locked mutex is freed.
|
||||
|
||||
2001-01-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
* gthread-solaris.c, gthread-posix.c: Made g_thread_min_stack_size
|
||||
|
@ -181,6 +181,11 @@ g_mutex_unlock_errorcheck_impl (GMutex *mutex,
|
||||
static void
|
||||
g_mutex_free_errorcheck_impl (GMutex *mutex)
|
||||
{
|
||||
if (info && info->owner != NULL)
|
||||
g_error ("Trying to free a locked mutex at '%s', "
|
||||
"which was previously locked at '%s'",
|
||||
location, info->location);
|
||||
|
||||
g_free (G_MUTEX_DEBUG_INFO (mutex));
|
||||
g_thread_functions_for_glib_use_default.mutex_free (mutex);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user