summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-24 18:33:52 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-24 18:44:15 +0900
commit8c9adcb6161ac74ddf4649bd63e73149fea82e6c (patch)
tree8e09e10f974965c1f6285e6ccac7d45532f1103d
parent8b20d8dd0d62d6e22f8b040f7ac2b0442b8e345a (diff)
efl ui image async locking -fix CID 1356199 - locked data cant be messed with
this addresses a coverity issue that in theory looks right fix CID 1356199 @fix
-rw-r--r--src/lib/elementary/efl_ui_image.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index dad075496f..e65b95c510 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -257,10 +257,13 @@ _efl_ui_image_async_open_do(void *data, Ecore_Thread *thread EINA_UNUSED)
257 done = sd->async.done; 257 done = sd->async.done;
258 sd->async.todo = NULL; 258 sd->async.todo = NULL;
259 sd->async.done = NULL; 259 sd->async.done = NULL;
260 eina_spinlock_release(&sd->async.lck);
261 260
262 if (done) _async_open_data_free(done); 261 if (done) _async_open_data_free(done);
263 if (!todo) return; 262 if (!todo)
263 {
264 eina_spinlock_release(&sd->async.lck);
265 return;
266 }
264 267
265begin: 268begin:
266 if (todo->f_set) 269 if (todo->f_set)
@@ -272,7 +275,6 @@ begin:
272 if (!f) 275 if (!f)
273 { 276 {
274 todo->failed = EINA_TRUE; 277 todo->failed = EINA_TRUE;
275 eina_spinlock_take(&sd->async.lck);
276 sd->async.done = todo; 278 sd->async.done = todo;
277 eina_spinlock_release(&sd->async.lck); 279 eina_spinlock_release(&sd->async.lck);
278 return; 280 return;
@@ -281,6 +283,7 @@ begin:
281 else 283 else
282 { 284 {
283 CRI("Async open has no input file!"); 285 CRI("Async open has no input file!");
286 eina_spinlock_release(&sd->async.lck);
284 return; 287 return;
285 } 288 }
286 289
@@ -288,6 +291,7 @@ begin:
288 { 291 {
289 if (!todo->f_set) eina_file_close(f); 292 if (!todo->f_set) eina_file_close(f);
290 _async_open_data_free(todo); 293 _async_open_data_free(todo);
294 eina_spinlock_release(&sd->async.lck);
291 return; 295 return;
292 } 296 }
293 297
@@ -301,6 +305,7 @@ begin:
301 if (map) eina_file_map_free(f, map); 305 if (map) eina_file_map_free(f, map);
302 if (!todo->f_set) eina_file_close(f); 306 if (!todo->f_set) eina_file_close(f);
303 _async_open_data_free(todo); 307 _async_open_data_free(todo);
308 eina_spinlock_release(&sd->async.lck);
304 return; 309 return;
305 } 310 }
306 311
@@ -312,11 +317,9 @@ begin:
312 done->f_open = f; 317 done->f_open = f;
313 done->map = map; 318 done->map = map;
314 319
315 eina_spinlock_take(&sd->async.lck);
316 todo = sd->async.todo; 320 todo = sd->async.todo;
317 sd->async.todo = NULL; 321 sd->async.todo = NULL;
318 if (!todo) sd->async.done = done; 322 if (!todo) sd->async.done = done;
319 eina_spinlock_release(&sd->async.lck);
320 323
321 if (todo) 324 if (todo)
322 { 325 {
@@ -324,6 +327,7 @@ begin:
324 _async_open_data_free(done); 327 _async_open_data_free(done);
325 goto begin; 328 goto begin;
326 } 329 }
330 eina_spinlock_release(&sd->async.lck);
327} 331}
328 332
329static void 333static void