forked from enlightenment/efl
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
This commit is contained in:
parent
2cf1fd3be9
commit
15cdd9b71b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue