raster pushed a commit to branch efl-1.20.

http://git.enlightenment.org/core/efl.git/commit/?id=d0d9da6f9e79d399aaa519d71231f2403ac49b25

commit d0d9da6f9e79d399aaa519d71231f2403ac49b25
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Aug 30 11:31:02 2017 +0900

    eina file - use recursive locks for cache and file to avoid deadlock
    
    since we have a sigbusd handler that flags an eina file with io errors
    it has to walk the file cache and every file... taking locks. if those
    locks were taking already in the current thread the sighandler was
    called in... we'd deadlock. since this basicallly never happens (when
    do we see i/o errors really? not much)... we never saw this as it'd
    also reauire this race condition to happen too. but it is a problem
    waiting to happen. this fixes that by moving to recrusive locks.
    
    @fix
---
 src/lib/eina/eina_file_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index e0d164a2c2..91036398cc 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -426,7 +426,7 @@ eina_file_virtualize(const char *virtual_name, const void 
*data, unsigned long l
    else
      sprintf((char *)file->filename, tmpname, ti);
 
-   eina_lock_new(&file->lock);
+   eina_lock_recursive_new(&file->lock);
    file->mtime = ti / 1000;
    file->length = length;
 #ifdef _STAT_VER_LINUX
@@ -1063,7 +1063,7 @@ eina_file_init(void)
         return EINA_FALSE;
      }
 
-   eina_lock_new(&_eina_file_lock_cache);
+   eina_lock_recursive_new(&_eina_file_lock_cache);
    eina_magic_string_set(EINA_FILE_MAGIC, "Eina_File");
 
    return EINA_TRUE;

-- 


Reply via email to