gst_element_threadsafe_properties_pre_run (GstElement *element)
{
GST_DEBUG (GST_CAT_THREAD, "locking element %s", GST_OBJECT_NAME (element));
- //g_mutex_lock (element->property_mutex);
+ g_mutex_lock (element->property_mutex);
gst_element_set_pending_properties (element);
}
gst_element_threadsafe_properties_post_run (GstElement *element)
{
GST_DEBUG (GST_CAT_THREAD, "unlocking element %s", GST_OBJECT_NAME (element));
- //g_mutex_unlock (element->property_mutex);
+ g_mutex_unlock (element->property_mutex);
}
void
if (from->post_run_func) \
from->post_run_func (from); \
SCHED (element)->current = element; \
+ if (element->pre_run_func) \
+ element->pre_run_func (element); \
do_cothread_switch (GST_ELEMENT_THREADSTATE (element)); \
- /* we assume other cothread switches will set ->current \
- * properly, no need to do it from this side */ \
- if (from->pre_run_func) \
- from->pre_run_func (from); \
}G_STMT_END
static GType
GST_FLAG_UNSET (element, GST_ELEMENT_COTHREAD_STOPPING);
gst_object_unref (GST_OBJECT (element));
+ /* this will return to cothread 0, so we need to unlock the current element */
+ if (element->post_run_func)
+ element->post_run_func (element);
+
GST_DEBUG_LEAVE ("(%d,'%s')", argc, name);
return 0;
}
gst_basic_scheduler_interrupt (GstScheduler *sched, GstElement *element)
{
GstElement *current = SCHED (element)->current;
-
+
GST_FLAG_SET (element, GST_ELEMENT_COTHREAD_STOPPING);
if (current->post_run_func)
bsched->current = entry;
do_cothread_switch (GST_ELEMENT_THREADSTATE (entry));
- if (bsched->current && bsched->current->post_run_func)
- bsched->current->post_run_func (bsched->current);
-
state = GST_SCHEDULER_STATE (sched);
/* if something changed, return - go on else */
if (GST_FLAG_IS_SET(bsched, GST_BASIC_SCHEDULER_CHANGE) &&