diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-05-31 16:49:33 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-05-31 16:49:33 +0000 |
commit | 9d24b6731ea24fa81cf76ff88ba0a5c0454237b0 (patch) | |
tree | 3414f132e52e3fbc11af881c682f98a85414e766 | |
parent | 9ba9a7bd0d4e58189352ca58f24d7f37b0ae9f20 (diff) | |
download | vdr-plugin-live-9d24b6731ea24fa81cf76ff88ba0a5c0454237b0.tar.gz vdr-plugin-live-9d24b6731ea24fa81cf76ff88ba0a5c0454237b0.tar.bz2 |
- made filecache threadsafe
-rw-r--r-- | filecache.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/filecache.h b/filecache.h index 89d884f..5c1e83d 100644 --- a/filecache.h +++ b/filecache.h @@ -4,6 +4,7 @@ #include <numeric> #include <string> #include <vector> +#include <vdr/thread.h> #include <vdr/tools.h> #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; |