/* Note that it is generally not a good idea to reuse an existing cancellable for more operations after it has been cancelled once, as this function might tempt you to do. The recommended practice is to drop the reference to a cancellable after cancelling it, and let it die with the outstanding async operations. You should create a fresh cancellable for further async operations.  */
void g_cancellable_reset(GCancellable *cancellable)
/* Note that it is generally not a good idea to reuse an existing cancellable for more operations after it has been cancelled once, as this function might tempt you to do. The recommended practice is to drop the reference to a cancellable after cancelling it, and let it die with the outstanding async operations. You should create a fresh cancellable for further async operations.  */
void g_cancellable_reset(GCancellable *cancellable)
{
  GCancellablePrivate *priv;
  g_return_if_fail (G_IS_CANCELLABLE (cancellable));
  g_mutex_lock (&cancellable_mutex);
  priv = cancellable->priv;
  while (priv->cancelled_running)
    {
      priv->cancelled_running_waiting = TRUE;
      g_cond_wait (&cancellable_cond, &cancellable_mutex);
    }
  if (priv->cancelled)
    {
      if (priv->wakeup)
        GLIB_PRIVATE_CALL (g_wakeup_acknowledge) (priv->wakeup);
      priv->cancelled = FALSE;
    }
  g_mutex_unlock (&cancellable_mutex);
}