Neither was used, and the Windows version could lead to live-locks.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=43744
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44609
Reviewed-by: Thiago Macieira <thiago@kde.org>
PTHREAD_CHECK ("pthread_cond_signal", pthread_cond_signal (&cond->cond));
}
-void
-_dbus_platform_condvar_wake_all (DBusCondVar *cond)
-{
- PTHREAD_CHECK ("pthread_cond_broadcast", pthread_cond_broadcast (&cond->cond));
-}
-
static void
check_monotonic_clock (void)
{
LeaveCriticalSection (&cond->lock);
}
-void
-_dbus_platform_condvar_wake_all (DBusCondVar *cond)
-{
- EnterCriticalSection (&cond->lock);
-
- while (cond->list != NULL)
- SetEvent (_dbus_list_pop_first (&cond->list));
-
- if (cond->list != NULL)
- {
- /* Avoid live lock by pushing the waiter to the mutex lock
- instruction, which is fair. If we don't do this, we could
- acquire the condition variable again before the waiter has a
- chance itself, leading to starvation. */
- Sleep (0);
- }
-
- LeaveCriticalSection (&cond->lock);
-}
-
dbus_bool_t
_dbus_threads_init_platform_specific (void)
{
DBusCMutex *mutex,
int timeout_milliseconds);
void _dbus_condvar_wake_one (DBusCondVar *cond);
-void _dbus_condvar_wake_all (DBusCondVar *cond);
void _dbus_condvar_new_at_location (DBusCondVar **location_p);
void _dbus_condvar_free_at_location (DBusCondVar **location_p);
DBusCMutex *mutex,
int timeout_milliseconds);
void _dbus_platform_condvar_wake_one (DBusCondVar *cond);
-void _dbus_platform_condvar_wake_all (DBusCondVar *cond);
DBUS_END_DECLS
_dbus_platform_condvar_wake_one (cond);
}
-/**
- * If there are threads waiting on the condition variable, wake
- * up all of them.
- * Does nothing if passed a #NULL pointer.
- */
-void
-_dbus_condvar_wake_all (DBusCondVar *cond)
-{
- if (cond && thread_init_generation == _dbus_current_generation)
- _dbus_platform_condvar_wake_all (cond);
-}
-
static void
shutdown_global_locks (void *data)
{