本文整理汇总了C++中Thing::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ Thing::Print方法的具体用法?C++ Thing::Print怎么用?C++ Thing::Print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thing
的用法示例。
在下文中一共展示了Thing::Print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MultiLockUnsafeThread
void * MultiLockUnsafeThread( void * p )
{
const unsigned int value = reinterpret_cast< unsigned int >( p );
Thing * thing = nullptr;
unsigned int jj = 0;
unsigned int tests = 0;
unsigned int fails = 0;
unsigned int randomIndex = 0;
try
{
for ( unsigned int ii = 0; ii < thingCount; ++ii )
{
for ( jj = 0; jj < thingCount; ++jj )
{
thing = const_cast< Thing * >( Thing::GetFromPool( jj ) );
assert( nullptr != thing );
thing->SetValue( value );
}
::GoToSleep( 2 );
if ( WillRedoSingleTests() )
{
SingleThreadSimpleTest();
SingleThreadReentrantTest();
SingleThreadSimpleMultiLockTest();
SingleThreadComplexMultiLockTest( false );
SingleThreadExceptionTest();
}
thing = const_cast< Thing * >( Thing::GetFromPool( ii ) );
assert( nullptr != thing );
thing->Print( value, ii, 7 );
randomIndex = ( ::rand() % thingCount );
thing = const_cast< Thing * >( Thing::GetFromPool( randomIndex ) );
assert( nullptr != thing );
thing->Print( value, ii, 7 );
for ( jj = 0; jj < thingCount; ++jj )
{
thing = const_cast< Thing * >( Thing::GetFromPool( jj ) );
assert( nullptr != thing );
if ( thing->GetValue() != value )
fails++;
tests++;
}
::GoToSleep( 2 );
}
}
catch ( ... )
{
assert( false );
}
TestResults::GetIt()->SetResult( value, tests, fails );
return nullptr;
}