本文整理汇总了C++中AtomicInt::set方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomicInt::set方法的具体用法?C++ AtomicInt::set怎么用?C++ AtomicInt::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AtomicInt
的用法示例。
在下文中一共展示了AtomicInt::set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _test2
// _test2 verifies that a CIM Operation on a client connection will still
// succeed when the idleConnectionTimeout period is exceeded (_idleThd) *and*
// there is concurrent server activity (_runningThd) so that the Monitor
// will wake up and check for timeouts and close the connection.
// In this case, the second call to getClass() in _idleThd() will reconnect
// and send the request.
Boolean _test2(
int durationSeconds, const char * testUserid, const char * testPasswd)
{
try
{
sleepIterations.set(0);
// run tests
Array<Thread *> clientThreads;
test2CaughtException = false;
clientThreads.append(
_runTestThreads(
_runningThd, durationSeconds, testUserid, testPasswd));
clientThreads.append(
_runTestThreads(
_idleThd, durationSeconds, testUserid, testPasswd));
// wait for threads to terminate
for(Uint32 i=0; i< clientThreads.size(); i++)
{
clientThreads[i]->join();
}
// clean up threads
for(Uint32 i=0; i < clientThreads.size(); i++)
{
if(clientThreads[i])
delete clientThreads[i];
}
}
catch(Exception& e)
{
cerr << "Error: " << e.getMessage() << endl;
return TEST_FAILED;
}
// We do not expect exception in this case.
return (test2CaughtException == false);
}