mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
glib/tests/autoptr: Also ensure that GRecMutexLocker can re-lock a mutex
It's native in the actual GRecMutex, but better to check that again.
This commit is contained in:
parent
e2d2db6433
commit
15d2053122
@ -441,12 +441,17 @@ test_g_rec_mutex_locker (void)
|
||||
if (TRUE)
|
||||
{
|
||||
g_autoptr(GRecMutexLocker) val = g_rec_mutex_locker_new (&rec_mutex);
|
||||
g_autoptr(GRecMutexLocker) other = NULL;
|
||||
|
||||
g_assert_nonnull (val);
|
||||
|
||||
/* Verify that the mutex is actually locked */
|
||||
thread = g_thread_new ("rec mutex locked", rec_mutex_locked_thread, &rec_mutex);
|
||||
g_thread_join (thread);
|
||||
g_thread_join (g_steal_pointer (&thread));
|
||||
|
||||
other = g_rec_mutex_locker_new (&rec_mutex);
|
||||
thread = g_thread_new ("rec mutex locked", rec_mutex_locked_thread, &rec_mutex);
|
||||
g_thread_join (g_steal_pointer (&thread));
|
||||
}
|
||||
|
||||
/* Verify that the mutex is unlocked again */
|
||||
|
Loading…
Reference in New Issue
Block a user