equal
deleted
inserted
replaced
58 * set. Compile time thingy, does not involve runtime cost. |
58 * set. Compile time thingy, does not involve runtime cost. |
59 */ |
59 */ |
60 template<typename INTEGER> |
60 template<typename INTEGER> |
61 struct HighestBit |
61 struct HighestBit |
62 { |
62 { |
63 enum { Value = (1 << (8*sizeof(INTEGER) - 1)) }; |
63 enum { Value = ((INTEGER)1 << (8*sizeof(INTEGER) - 1)) }; |
64 }; |
64 }; |
65 |
65 |
66 |
66 |
67 |
67 |
68 |
68 |
326 { |
326 { |
327 delete instance_; |
327 delete instance_; |
328 instance_ = NULL; |
328 instance_ = NULL; |
329 } |
329 } |
330 |
330 |
|
331 const InitParams& IdxDbMgr::getInitParams() const |
|
332 { |
|
333 return initParams_; |
|
334 } |
331 |
335 |
332 IdxDbHndl IdxDbMgr::create(const char * qualBaseAppClass) |
336 IdxDbHndl IdxDbMgr::create(const char * qualBaseAppClass) |
333 { |
337 { |
334 using namespace std; |
338 using namespace std; |
335 using namespace Cpix; |
339 using namespace Cpix; |
530 |
534 |
531 |
535 |
532 Version IdxDbMgr::getNextVersion() |
536 Version IdxDbMgr::getNextVersion() |
533 { |
537 { |
534 Cpt::SyncRegion |
538 Cpt::SyncRegion |
535 sr(mutex_); |
539 sr(versionMutex_); |
536 |
540 |
537 Version |
541 Version |
538 rv = version_; |
542 rv = version_; |
539 |
543 |
540 ++version_; |
544 ++version_; |
892 IdxDbMgr::IdxDbMgr(InitParams & ip) |
896 IdxDbMgr::IdxDbMgr(InitParams & ip) |
893 : cpixDir_(ip.getCpixDir()), |
897 : cpixDir_(ip.getCpixDir()), |
894 regFilePath_(ip.getCpixDir()), |
898 regFilePath_(ip.getCpixDir()), |
895 maxIdleSec_(ip.getMaxIdleSec()), |
899 maxIdleSec_(ip.getMaxIdleSec()), |
896 mutex_(true), // recursive |
900 mutex_(true), // recursive |
|
901 versionMutex_(false), // not recursive |
897 version_(0), |
902 version_(0), |
898 initParams_(ip), |
903 initParams_(ip), |
899 housekeepCounter_(0) |
904 housekeepCounter_(0) |
900 { |
905 { |
901 regFilePath_ += "cpixreg.txt"; |
906 regFilePath_ += "cpixreg.txt"; |