/* Returns: TRUE on success, FALSE if an error occurred  */
gboolean g_thread_pool_push(GThreadPool *pool, gpointer data, GError **error)
/* Returns: TRUE on success, FALSE if an error occurred  */
gboolean g_thread_pool_push(GThreadPool *pool, gpointer data, GError **error)
{
  GRealThreadPool *real;
  gboolean result;
  real = (GRealThreadPool*) pool;
  g_return_val_if_fail (real, FALSE);
  g_return_val_if_fail (real->running, FALSE);
  result = TRUE;
  g_async_queue_lock (real->queue);
  if (g_async_queue_length_unlocked (real->queue) >= 0)
    {
      GError *local_error = NULL;
      if (!g_thread_pool_start_thread (real, &local_error))
        {
          g_propagate_error (error, local_error);
          result = FALSE;
        }
    }
  g_thread_pool_queue_push_unlocked (real, data);
  g_async_queue_unlock (real->queue);
  return result;
}