From 9d24b6731ea24fa81cf76ff88ba0a5c0454237b0 Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Thu, 31 May 2007 16:49:33 +0000 Subject: - made filecache threadsafe --- filecache.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/filecache.h b/filecache.h index 89d884f..5c1e83d 100644 --- a/filecache.h +++ b/filecache.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include "cache.h" @@ -40,6 +41,7 @@ public: ptr_type get( key_type const& key ) { + cMutexLock lock( &m_mutex ); dsyslog( "vdrlive::FileCache::get( %s )", key.c_str() ); dsyslog( "vdrlive::FileCache had %u entries (weight: %u)", count(), weight() ); ptr_type result = base_type::get( key ); @@ -47,6 +49,9 @@ public: dsyslog( "vdrlive::FileCache::get( %s ) = %p", key.c_str(), result.get() ); return result; } + +private: + cMutex m_mutex; }; //typedef vgstools::cache< std::string, FileObject > FileCache; -- cgit v1.2.3