forked from enlightenment/efl
evas: handle thread queue creation failure
eina_thread_queue_create() might fail. Actually it does fail on Mac OS X under some circumstances.
This commit is contained in:
parent
b3c8470024
commit
469cf26873
|
@ -871,15 +871,30 @@ evas_common_scale_sample_init(void)
|
||||||
if (eina_cpu_count() <= 2) return ;
|
if (eina_cpu_count() <= 2) return ;
|
||||||
|
|
||||||
thread_queue = eina_thread_queue_new();
|
thread_queue = eina_thread_queue_new();
|
||||||
|
if (EINA_UNLIKELY(!thread_queue))
|
||||||
|
{
|
||||||
|
ERR("Failed to create thread queue");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
main_queue = eina_thread_queue_new();
|
main_queue = eina_thread_queue_new();
|
||||||
|
if (EINA_UNLIKELY(!thread_queue))
|
||||||
|
{
|
||||||
|
ERR("Failed to create thread queue");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (!eina_thread_create(&scaling_thread, EINA_THREAD_NORMAL, -1,
|
if (!eina_thread_create(&scaling_thread, EINA_THREAD_NORMAL, -1,
|
||||||
_evas_common_scale_sample_thread, NULL))
|
_evas_common_scale_sample_thread, NULL))
|
||||||
{
|
{
|
||||||
return;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_thread = EINA_TRUE;
|
use_thread = EINA_TRUE;
|
||||||
|
return;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if (thread_queue) eina_thread_queue_free(thread_queue);
|
||||||
|
if (main_queue) eina_thread_queue_free(main_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
Loading…
Reference in New Issue