summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjiin.moon <jiin.moon@samsung.com>2016-03-15 11:57:19 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-03-15 11:57:25 -0700
commitcdb72864853d5c3d81148c7a5846f39300eb46dc (patch)
tree847e79e3c247ebbe9e9c7c1faf0900ff898fd64b /src
parentbdde588b164ffbd23839a701cf789b94b05077bb (diff)
evas: some changes for preload thread dead lock issue
Summary: Add spin lock to access to new flag can check to status of the preload Reviewers: jpeg, cedric, jypark Subscribers: raster Differential Revision: https://phab.enlightenment.org/D3775 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/cache/evas_cache_image.c21
-rw-r--r--src/lib/evas/include/evas_common_private.h2
2 files changed, 19 insertions, 4 deletions
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index 49b19769e1..2cd2e909b4 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -330,7 +330,6 @@ _evas_cache_image_async_heavy(void *data)
330 current = data; 330 current = data;
331 331
332 SLKL(current->lock); 332 SLKL(current->lock);
333 current->flags.load_worked = 0;
334 pchannel = current->channel; 333 pchannel = current->channel;
335 current->channel++; 334 current->channel++;
336 cache = current->cache; 335 cache = current->cache;
@@ -374,8 +373,11 @@ _evas_cache_image_async_heavy(void *data)
374 current->flags.preload_done = 0; 373 current->flags.preload_done = 0;
375 } 374 }
376 SLKU(current->lock_cancel); 375 SLKU(current->lock_cancel);
377 current->flags.load_worked = 1;
378 SLKU(current->lock); 376 SLKU(current->lock);
377
378 LKL(wakeup);
379 current->flags.preload_pending = 0;
380 LKU(wakeup);
379} 381}
380 382
381static void 383static void
@@ -390,6 +392,11 @@ _evas_cache_image_async_end(void *data)
390 ie->preload = NULL; 392 ie->preload = NULL;
391 ie->flags.preload_done = ie->flags.loaded; 393 ie->flags.preload_done = ie->flags.loaded;
392 ie->flags.updated_data = 1; 394 ie->flags.updated_data = 1;
395
396 LKL(wakeup);
397 ie->flags.preload_pending = 0;
398 LKU(wakeup);
399
393 while ((tmp = ie->targets)) 400 while ((tmp = ie->targets))
394 { 401 {
395 evas_object_inform_call_image_preloaded((Evas_Object*) tmp->target); 402 evas_object_inform_call_image_preloaded((Evas_Object*) tmp->target);
@@ -411,6 +418,11 @@ _evas_cache_image_async_cancel(void *data)
411 418
412 ie->preload = NULL; 419 ie->preload = NULL;
413 ie->cache->pending = eina_list_remove(ie->cache->pending, ie); 420 ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
421
422 LKL(wakeup);
423 ie->flags.preload_pending = 0;
424 LKU(wakeup);
425
414 if ((ie->flags.delete_me) || (ie->flags.dirty)) 426 if ((ie->flags.delete_me) || (ie->flags.dirty))
415 { 427 {
416 ie->flags.delete_me = 0; 428 ie->flags.delete_me = 0;
@@ -468,6 +480,9 @@ _evas_cache_image_entry_preload_add(Image_Entry *ie, const Eo *target,
468 { 480 {
469 ie->cache->preload = eina_list_append(ie->cache->preload, ie); 481 ie->cache->preload = eina_list_append(ie->cache->preload, ie);
470 ie->flags.pending = 0; 482 ie->flags.pending = 0;
483 LKL(wakeup);
484 ie->flags.preload_pending = 1;
485 LKU(wakeup);
471 ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy, 486 ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy,
472 _evas_cache_image_async_end, 487 _evas_cache_image_async_end,
473 _evas_cache_image_async_cancel, 488 _evas_cache_image_async_cancel,
@@ -1162,7 +1177,7 @@ evas_cache_image_load_data(Image_Entry *im)
1162 evas_async_events_process(); 1177 evas_async_events_process();
1163 1178
1164 LKL(wakeup); 1179 LKL(wakeup);
1165 while (!im->flags.load_worked) 1180 while (im->flags.preload_pending)
1166 { 1181 {
1167 eina_condition_wait(&cond_wakeup); 1182 eina_condition_wait(&cond_wakeup);
1168 LKU(wakeup); 1183 LKU(wakeup);
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h
index 1833d54e31..ca074415ef 100644
--- a/src/lib/evas/include/evas_common_private.h
+++ b/src/lib/evas/include/evas_common_private.h
@@ -568,7 +568,7 @@ struct _Image_Entry_Flags
568 Eina_Bool updated_data : 1; 568 Eina_Bool updated_data : 1;
569 Eina_Bool flipped : 1; 569 Eina_Bool flipped : 1;
570 Eina_Bool textured : 1; 570 Eina_Bool textured : 1;
571 Eina_Bool load_worked : 1; 571 Eina_Bool preload_pending : 1;
572}; 572};
573 573
574struct _Image_Entry_Frame 574struct _Image_Entry_Frame