summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-29 21:18:04 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-29 21:18:04 +0900
commit42a46214c4f9b35c0e1f5a84c56ea76ba2235eae (patch)
tree00a46d84cf39424623e50ed19403ff36af01146a /src/lib/evas/common
parent70f443d8a8e1dcf9e9f163190ffc228ace6660de (diff)
other async render issue - sync ALL rendering canvases, not just one
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_thread_render.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/evas/common/evas_thread_render.c b/src/lib/evas/common/evas_thread_render.c
index f37f43a6f7..3474469450 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -4,6 +4,7 @@
4 4
5static Eina_Thread evas_thread_worker; 5static Eina_Thread evas_thread_worker;
6static Eina_Condition evas_thread_queue_condition; 6static Eina_Condition evas_thread_queue_condition;
7static Eina_Lock evas_thread_block_lock;
7static Eina_Lock evas_thread_queue_lock; 8static Eina_Lock evas_thread_queue_lock;
8static Eina_Bool evas_thread_queue_ready = EINA_FALSE; 9static Eina_Bool evas_thread_queue_ready = EINA_FALSE;
9static Eina_Inarray evas_thread_queue; 10static Eina_Inarray evas_thread_queue;
@@ -55,7 +56,19 @@ evas_thread_queue_flush(Evas_Thread_Command_Cb cb, void *data)
55 evas_thread_queue_append(cb, data, EINA_TRUE); 56 evas_thread_queue_append(cb, data, EINA_TRUE);
56} 57}
57 58
58static void* 59EAPI void
60evas_thread_queue_block(void)
61{
62 eina_lock_take(&evas_thread_block_lock);
63}
64
65EAPI void
66evas_thread_queue_unblock(void)
67{
68 eina_lock_release(&evas_thread_block_lock);
69}
70
71static void *
59evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED) 72evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
60{ 73{
61 while (1) 74 while (1)
@@ -83,6 +96,8 @@ evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
83 continue; 96 continue;
84 } 97 }
85 98
99 eina_lock_take(&evas_thread_block_lock);
100
86 cmd = evas_thread_queue.members; 101 cmd = evas_thread_queue.members;
87 evas_thread_queue.members = evas_thread_queue_cache; 102 evas_thread_queue.members = evas_thread_queue_cache;
88 evas_thread_queue_cache = cmd; 103 evas_thread_queue_cache = cmd;
@@ -109,6 +124,7 @@ evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
109 cmd++; 124 cmd++;
110 len--; 125 len--;
111 } 126 }
127 eina_lock_release(&evas_thread_block_lock);
112 } 128 }
113 129
114out: 130out:
@@ -128,6 +144,8 @@ evas_thread_init(void)
128 144
129 if (!eina_lock_new(&evas_thread_queue_lock)) 145 if (!eina_lock_new(&evas_thread_queue_lock))
130 CRIT("Could not create draw thread lock"); 146 CRIT("Could not create draw thread lock");
147 if (!eina_lock_new(&evas_thread_block_lock))
148 CRIT("Could not create draw thread block lock");
131 if (!eina_condition_new(&evas_thread_queue_condition, &evas_thread_queue_lock)) 149 if (!eina_condition_new(&evas_thread_queue_condition, &evas_thread_queue_lock))
132 CRIT("Could not create draw thread condition"); 150 CRIT("Could not create draw thread condition");
133 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0, 151 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0,
@@ -154,6 +172,7 @@ evas_thread_shutdown(void)
154 evas_async_events_process(); 172 evas_async_events_process();
155 173
156 eina_thread_join(evas_thread_worker); 174 eina_thread_join(evas_thread_worker);
175 eina_lock_free(&evas_thread_block_lock);
157 eina_lock_free(&evas_thread_queue_lock); 176 eina_lock_free(&evas_thread_queue_lock);
158 eina_condition_free(&evas_thread_queue_condition); 177 eina_condition_free(&evas_thread_queue_condition);
159 178