projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7338164
)
eina: avoid possible race condition when unreffing an Eina_File.
author
Cedric Bail
<cedric.bail@samsung.com>
Mon, 28 Oct 2013 09:23:02 +0000
(18:23 +0900)
committer
Cedric Bail
<cedric.bail@samsung.com>
Mon, 28 Oct 2013 09:32:40 +0000
(18:32 +0900)
src/lib/eina/eina_file_common.c
patch
|
blob
|
history
diff --git
a/src/lib/eina/eina_file_common.c
b/src/lib/eina/eina_file_common.c
index
ac7d020
..
e5b1250
100644
(file)
--- a/
src/lib/eina/eina_file_common.c
+++ b/
src/lib/eina/eina_file_common.c
@@
-445,12
+445,15
@@
eina_file_dup(Eina_File *file)
EAPI void
eina_file_close(Eina_File *file)
{
+ Eina_Bool leave = EINA_TRUE;
+
EINA_SAFETY_ON_NULL_RETURN(file);
eina_lock_take(&file->lock);
file->refcount--;
+ if (file->refcount == 0) leave = EINA_FALSE;
eina_lock_release(&file->lock);
- if (
file->refcount != 0
) return;
+ if (
leave
) return;
eina_lock_take(&_eina_file_lock_cache);