Beispiel #1
0
void
_g_thread_pool_shutdown (void)
{
  GThread *thread;

  g_thread_pool_set_max_unused_threads (0);

  G_LOCK (threads);
  while (active_threads != NULL)
    {
      thread = g_thread_ref (active_threads->data);
      G_UNLOCK (threads);
      g_thread_join (thread);
      G_LOCK (threads);
    }
  while (finished_threads != NULL)
    {
      thread = finished_threads->data;
      finished_threads = g_slist_delete_link (finished_threads,
                                              finished_threads);
      G_UNLOCK (threads);
      g_thread_join (thread);
      G_LOCK (threads);
    }
  G_UNLOCK (threads);

  if (unused_thread_queue)
    {
      g_async_queue_unref (unused_thread_queue);
      unused_thread_queue = NULL;
    }
}
/**
 * gst_gl_context_get_thread:
 * @context: a #GstGLContext
 *
 * Returns: (transfer full): The #GThread, @context is current in or NULL
 *
 * Since: 1.6
 */
GThread *
gst_gl_context_get_thread (GstGLContext * context)
{
  GThread *ret;

  GST_OBJECT_LOCK (context);
  ret = context->priv->active_thread;
  if (ret)
    g_thread_ref (ret);
  GST_OBJECT_UNLOCK (context);

  return ret;
}