From ea768b490a1881dfa443f16ade34300088bbdf94 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 21 Mar 2013 05:23:06 +0000 Subject: The Bu::MyriadCache now ensures that it saves the myriad structure after saving an entry or syncing. --- src/unstable/myriadcache.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/unstable/myriadcache.h b/src/unstable/myriadcache.h index 7f83250..ce0f2fa 100644 --- a/src/unstable/myriadcache.h +++ b/src/unstable/myriadcache.h @@ -103,11 +103,13 @@ namespace Bu Bu::MyriadStream ms = mStore.openStream( hIndex.get( o->getKey() ) ); _cacheObjectSave( ms, o ); ms.setSize( ms.tell() ); + + mStore.sync(); } virtual void _sync() { - Bu::ReadWriteMutex::ReadLocker wl( rwStore ); + Bu::ReadWriteMutex::WriteLocker wl( rwStore ); if( !bStructureChanged ) return; @@ -118,6 +120,8 @@ namespace Bu ms.setSize( ms.tell() ); bStructureChanged = false; + + mStore.sync(); } private: -- cgit v1.2.3