本文整理汇总了C++中DbTxn::id方法的典型用法代码示例。如果您正苦于以下问题:C++ DbTxn::id方法的具体用法?C++ DbTxn::id怎么用?C++ DbTxn::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbTxn
的用法示例。
在下文中一共展示了DbTxn::id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sync
void
Freeze::BackgroundSaveEvictorI::run()
{
try
{
for(;;)
{
deque<BackgroundSaveEvictorElementPtr> allObjects;
deque<BackgroundSaveEvictorElementPtr> deadObjects;
size_t saveNowThreadsSize = 0;
{
Lock sync(*this);
while(!_savingThreadDone &&
(_saveNowThreads.size() == 0) &&
(_saveSizeTrigger < 0 || static_cast<Int>(_modifiedQueue.size()) < _saveSizeTrigger))
{
if(_savePeriod == IceUtil::Time::milliSeconds(0))
{
wait();
}
else if(timedWait(_savePeriod) == false)
{
//
// Timeout, so let's save
//
break; // while
}
}
saveNowThreadsSize = _saveNowThreads.size();
if(_savingThreadDone)
{
assert(_modifiedQueue.size() == 0);
assert(saveNowThreadsSize == 0);
break; // for(;;)
}
//
// Check first if there is something to do!
//
if(_modifiedQueue.size() == 0)
{
if(saveNowThreadsSize > 0)
{
_saveNowThreads.clear();
notifyAll();
}
continue; // for(;;)
}
_modifiedQueue.swap(allObjects);
}
const size_t size = allObjects.size();
deque<StreamedObjectPtr> streamedObjectQueue;
Long streamStart = IceUtil::Time::now(IceUtil::Time::Monotonic).toMilliSeconds();
//
// Stream each element
//
for(size_t i = 0; i < size; i++)
{
BackgroundSaveEvictorElementPtr& element = allObjects[i];
bool tryAgain;
do
{
tryAgain = false;
ObjectPtr servant = 0;
//
// These elements can't be stale as only elements with
// usageCount == 0 can become stale, and the modifiedQueue
// (us now) owns one count.
//
IceUtil::Mutex::Lock lockElement(element->mutex);
Byte status = element->status;
switch(status)
{
case created:
case modified:
{
servant = element->rec.servant;
break;
}
case destroyed:
{
size_t index = streamedObjectQueue.size();
streamedObjectQueue.resize(index + 1);
streamedObjectQueue[index] = new StreamedObject;
stream(element, streamStart, streamedObjectQueue[index]);
//.........这里部分代码省略.........