Lines Matching refs:stress
158 wait_for_ready (GstHarnessThread * thread, struct view_stress *stress) in wait_for_ready() argument
160 g_mutex_lock (&stress->lock); in wait_for_ready()
161 while (!stress->ready) in wait_for_ready()
162 g_cond_wait (&stress->cond, &stress->lock); in wait_for_ready()
163 g_mutex_unlock (&stress->lock); in wait_for_ready()
167 get_unref_image_view (GstHarnessThread * thread, struct view_stress *stress) in get_unref_image_view() argument
173 mem = g_queue_peek_nth (stress->memories, rand); in get_unref_image_view()
177 g_atomic_int_inc (&stress->n_ops); in get_unref_image_view()
178 if (g_atomic_int_get (&stress->n_ops) > N_OPS) in get_unref_image_view()
185 struct view_stress stress; in GST_START_TEST() local
189 g_mutex_init (&stress.lock); in GST_START_TEST()
190 g_cond_init (&stress.cond); in GST_START_TEST()
191 stress.ready = FALSE; in GST_START_TEST()
192 g_atomic_int_set (&stress.n_ops, 0); in GST_START_TEST()
193 stress.memories = g_queue_new (); in GST_START_TEST()
197 g_queue_push_head (stress.memories, create_image_mem (&v_info)); in GST_START_TEST()
200 g_mutex_lock (&stress.lock); in GST_START_TEST()
202 stress.threads[i] = gst_harness_stress_custom_start (h, in GST_START_TEST()
203 (GFunc) wait_for_ready, (GFunc) get_unref_image_view, &stress, 10); in GST_START_TEST()
205 stress.ready = TRUE; in GST_START_TEST()
206 g_cond_broadcast (&stress.cond); in GST_START_TEST()
207 g_mutex_unlock (&stress.lock); in GST_START_TEST()
209 while (g_atomic_int_get (&stress.n_ops) < N_OPS) in GST_START_TEST()
213 gst_harness_stress_thread_stop (stress.threads[i]); in GST_START_TEST()
216 g_mutex_clear (&stress.lock); in GST_START_TEST()
217 g_cond_clear (&stress.cond); in GST_START_TEST()
218 g_queue_free_full (stress.memories, (GDestroyNotify) gst_memory_unref); in GST_START_TEST()