diff options
author | Mike Buland <eichlan@xagasoft.com> | 2013-03-21 05:23:06 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2013-03-21 05:23:06 +0000 |
commit | ea768b490a1881dfa443f16ade34300088bbdf94 (patch) | |
tree | e4116d063e060e8a7bd70dba1b1d3777cc3e3927 /src/unstable | |
parent | 8cdac01404433c8ad9651a5b87b496ea548c883e (diff) | |
download | libbu++-ea768b490a1881dfa443f16ade34300088bbdf94.tar.gz libbu++-ea768b490a1881dfa443f16ade34300088bbdf94.tar.bz2 libbu++-ea768b490a1881dfa443f16ade34300088bbdf94.tar.xz libbu++-ea768b490a1881dfa443f16ade34300088bbdf94.zip |
The Bu::MyriadCache now ensures that it saves the myriad structure after
saving an entry or syncing.
Diffstat (limited to '')
-rw-r--r-- | src/unstable/myriadcache.h | 6 |
1 files changed, 5 insertions, 1 deletions
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 | |||
103 | Bu::MyriadStream ms = mStore.openStream( hIndex.get( o->getKey() ) ); | 103 | Bu::MyriadStream ms = mStore.openStream( hIndex.get( o->getKey() ) ); |
104 | _cacheObjectSave( ms, o ); | 104 | _cacheObjectSave( ms, o ); |
105 | ms.setSize( ms.tell() ); | 105 | ms.setSize( ms.tell() ); |
106 | |||
107 | mStore.sync(); | ||
106 | } | 108 | } |
107 | 109 | ||
108 | virtual void _sync() | 110 | virtual void _sync() |
109 | { | 111 | { |
110 | Bu::ReadWriteMutex::ReadLocker wl( rwStore ); | 112 | Bu::ReadWriteMutex::WriteLocker wl( rwStore ); |
111 | if( !bStructureChanged ) | 113 | if( !bStructureChanged ) |
112 | return; | 114 | return; |
113 | 115 | ||
@@ -118,6 +120,8 @@ namespace Bu | |||
118 | ms.setSize( ms.tell() ); | 120 | ms.setSize( ms.tell() ); |
119 | 121 | ||
120 | bStructureChanged = false; | 122 | bStructureChanged = false; |
123 | |||
124 | mStore.sync(); | ||
121 | } | 125 | } |
122 | 126 | ||
123 | private: | 127 | private: |