Each cache slot now contains a mutex. This mutex is locked in the OPEN
commitc7eb61515bad89e52265fd357a53e31d6bd9bb30
authorBen Kibbey <bjk@luxsci.net>
Sat, 24 Nov 2007 19:09:45 +0000 (24 14:09 -0500)
committerBen Kibbey <bjk@luxsci.net>
Sat, 24 Nov 2007 19:09:45 +0000 (24 14:09 -0500)
tree1438f91d241ed4b4bbe852c976b4cc52a3d2e546
parent88ee6e7b0f3c45318dc7283d9753cab6c55c52f9
Each cache slot now contains a mutex. This mutex is locked in the OPEN
and SAVE commands and released after the command ends. This fixes the
cache mutex being locked for long periods of time and having
adjust_cache_time_thread() spawn threads that stacked until the cache
mutex was released.

The file_cache_t also contains a new member .refcount. This keeps
track of how many clients are using this slot so the cache modifying
commands don't overwrite the mutex.
src/cache.c
src/cache.h
src/commands.c
src/common.h
src/pwmd.c