diff options
author | Jean Guyomarc'h <jean.guyomarch@openwide.fr> | 2016-08-23 16:51:54 +0200 |
---|---|---|
committer | Jean Guyomarc'h <jean.guyomarch@gmail.com> | 2016-08-23 21:15:24 +0200 |
commit | 469cf26873403f0453841ff9902d7d8b73cdc434 (patch) | |
tree | 9071b67433f73abc3f271d8d7346513ad2a70ab8 /src/lib/evas/common | |
parent | b3c8470024ad11c83dba97955075464293afbff1 (diff) |
evas: handle thread queue creation failure
eina_thread_queue_create() might fail.
Actually it does fail on Mac OS X under
some circumstances.
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r-- | src/lib/evas/common/evas_scale_sample.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c index 61f071f1de..008e43dea2 100644 --- a/src/lib/evas/common/evas_scale_sample.c +++ b/src/lib/evas/common/evas_scale_sample.c | |||
@@ -871,15 +871,30 @@ evas_common_scale_sample_init(void) | |||
871 | if (eina_cpu_count() <= 2) return ; | 871 | if (eina_cpu_count() <= 2) return ; |
872 | 872 | ||
873 | thread_queue = eina_thread_queue_new(); | 873 | thread_queue = eina_thread_queue_new(); |
874 | if (EINA_UNLIKELY(!thread_queue)) | ||
875 | { | ||
876 | ERR("Failed to create thread queue"); | ||
877 | goto cleanup; | ||
878 | } | ||
874 | main_queue = eina_thread_queue_new(); | 879 | main_queue = eina_thread_queue_new(); |
880 | if (EINA_UNLIKELY(!thread_queue)) | ||
881 | { | ||
882 | ERR("Failed to create thread queue"); | ||
883 | goto cleanup; | ||
884 | } | ||
875 | 885 | ||
876 | if (!eina_thread_create(&scaling_thread, EINA_THREAD_NORMAL, -1, | 886 | if (!eina_thread_create(&scaling_thread, EINA_THREAD_NORMAL, -1, |
877 | _evas_common_scale_sample_thread, NULL)) | 887 | _evas_common_scale_sample_thread, NULL)) |
878 | { | 888 | { |
879 | return; | 889 | goto cleanup; |
880 | } | 890 | } |
881 | 891 | ||
882 | use_thread = EINA_TRUE; | 892 | use_thread = EINA_TRUE; |
893 | return; | ||
894 | |||
895 | cleanup: | ||
896 | if (thread_queue) eina_thread_queue_free(thread_queue); | ||
897 | if (main_queue) eina_thread_queue_free(main_queue); | ||
883 | } | 898 | } |
884 | 899 | ||
885 | EAPI void | 900 | EAPI void |