mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-05 00:46:16 +01:00
Remove "temporary until GLib is fixed" code
The original GMutex/GCond rework patch introduced some temporary code to cope with GLib's old approach to thread initialisation. These are no longer required.
This commit is contained in:
parent
e996a836e8
commit
646de11ae7
@ -82,10 +82,6 @@ g_mutex_lock (GMutex *mutex)
|
||||
{
|
||||
gint status;
|
||||
|
||||
/* temporary until we fix libglib */
|
||||
if (mutex == NULL)
|
||||
return;
|
||||
|
||||
if G_UNLIKELY ((status = pthread_mutex_lock (&mutex->impl)) != 0)
|
||||
g_thread_abort (status, "pthread_mutex_lock");
|
||||
}
|
||||
@ -95,10 +91,6 @@ g_mutex_unlock (GMutex *mutex)
|
||||
{
|
||||
gint status;
|
||||
|
||||
/* temporary until we fix libglib */
|
||||
if (mutex == NULL)
|
||||
return;
|
||||
|
||||
if G_UNLIKELY ((status = pthread_mutex_unlock (&mutex->impl)) != 0)
|
||||
g_thread_abort (status, "pthread_mutex_lock");
|
||||
}
|
||||
@ -108,10 +100,6 @@ g_mutex_trylock (GMutex *mutex)
|
||||
{
|
||||
gint status;
|
||||
|
||||
/* temporary until we fix libglib */
|
||||
if (mutex == NULL)
|
||||
return TRUE;
|
||||
|
||||
if G_LIKELY ((status = pthread_mutex_trylock (&mutex->impl)) == 0)
|
||||
return TRUE;
|
||||
|
||||
@ -156,10 +144,6 @@ g_cond_signal (GCond *cond)
|
||||
{
|
||||
gint status;
|
||||
|
||||
/* temporary until we fix libglib */
|
||||
if (cond == NULL)
|
||||
return;
|
||||
|
||||
if G_UNLIKELY ((status = pthread_cond_signal (&cond->impl)) != 0)
|
||||
g_thread_abort (status, "pthread_cond_signal");
|
||||
}
|
||||
@ -169,10 +153,6 @@ g_cond_broadcast (GCond *cond)
|
||||
{
|
||||
gint status;
|
||||
|
||||
/* temporary until we fix libglib */
|
||||
if (cond == NULL)
|
||||
return;
|
||||
|
||||
if G_UNLIKELY ((status = pthread_cond_broadcast (&cond->impl)) != 0)
|
||||
g_thread_abort (status, "pthread_cond_broadcast");
|
||||
}
|
||||
|
@ -136,30 +136,18 @@ g_mutex_clear (GMutex *mutex)
|
||||
void
|
||||
g_mutex_lock (GMutex *mutex)
|
||||
{
|
||||
/* temporary until we fix libglib */
|
||||
if (mutex == NULL)
|
||||
return;
|
||||
|
||||
g_thread_impl_vtable.AcquireSRWLockExclusive (mutex);
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_mutex_trylock (GMutex *mutex)
|
||||
{
|
||||
/* temporary until we fix libglib */
|
||||
if (mutex == NULL)
|
||||
return TRUE;
|
||||
|
||||
return g_thread_impl_vtable.TryAcquireSRWLockExclusive (mutex);
|
||||
}
|
||||
|
||||
void
|
||||
g_mutex_unlock (GMutex *mutex)
|
||||
{
|
||||
/* temporary until we fix libglib */
|
||||
if (mutex == NULL)
|
||||
return;
|
||||
|
||||
g_thread_impl_vtable.ReleaseSRWLockExclusive (mutex);
|
||||
}
|
||||
|
||||
@ -180,20 +168,12 @@ g_cond_clear (GCond *cond)
|
||||
void
|
||||
g_cond_signal (GCond *cond)
|
||||
{
|
||||
/* temporary until we fix libglib */
|
||||
if (cond == NULL)
|
||||
return;
|
||||
|
||||
g_thread_impl_vtable.WakeConditionVariable (cond);
|
||||
}
|
||||
|
||||
void
|
||||
g_cond_broadcast (GCond *cond)
|
||||
{
|
||||
/* temporary until we fix libglib */
|
||||
if (cond == NULL)
|
||||
return;
|
||||
|
||||
g_thread_impl_vtable.WakeAllConditionVariable (cond);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user