move caching locking to rwlock

This commit is contained in:
roberto@maverick64
2011-02-13 18:58:51 +01:00
parent 238c98c0bd
commit 7744285dc3
6 changed files with 91 additions and 18 deletions
+2 -2
View File
@@ -584,13 +584,13 @@ void master_loop(char **argv, char **environ) {
// remove expired cache items
if (uwsgi.cache_max_items > 0) {
for(i=0;i< (int)uwsgi.cache_max_items;i++) {
uwsgi_lock(uwsgi.cache_lock);
uwsgi_wlock(uwsgi.cache_lock);
if (uwsgi.cache_items[i].expires) {
if (uwsgi.cache_items[i].expires < current_time) {
uwsgi_cache_del(uwsgi.cache_items[i].key, uwsgi.cache_items[i].keysize);
}
}
uwsgi_unlock(uwsgi.cache_lock);
uwsgi_rwunlock(uwsgi.cache_lock);
}
}