本文整理汇总了C++中FOutputDevice::CanBeUsedOnAnyThread方法的典型用法代码示例。如果您正苦于以下问题:C++ FOutputDevice::CanBeUsedOnAnyThread方法的具体用法?C++ FOutputDevice::CanBeUsedOnAnyThread怎么用?C++ FOutputDevice::CanBeUsedOnAnyThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOutputDevice
的用法示例。
在下文中一共展示了FOutputDevice::CanBeUsedOnAnyThread方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnsynchronizedFlushThreadedLogs
/**
* The unsynchronized version of FlushThreadedLogs.
* Assumes that the caller holds a lock on SynchronizationObject.
*/
void FOutputDeviceRedirector::UnsynchronizedFlushThreadedLogs( bool bUseAllDevices )
{
for(int32 LineIndex = 0;LineIndex < BufferedLines.Num();LineIndex++)
{
FBufferedLine BufferedLine = BufferedLines[LineIndex];
for( int32 OutputDeviceIndex=0; OutputDeviceIndex<OutputDevices.Num(); OutputDeviceIndex++ )
{
FOutputDevice* OutputDevice = OutputDevices[OutputDeviceIndex];
if( OutputDevice->CanBeUsedOnAnyThread() || bUseAllDevices )
{
OutputDevice->Serialize( *BufferedLine.Data, BufferedLine.Verbosity, BufferedLine.Category, BufferedLine.Time );
}
}
}
BufferedLines.Empty();
}
示例2: PanicFlushThreadedLogs
void FOutputDeviceRedirector::PanicFlushThreadedLogs()
{
SCOPE_CYCLE_COUNTER(STAT_FlushThreadedLogs);
// Acquire a lock on SynchronizationObject and call the unsynchronized worker function.
FScopeLock ScopeLock( &SynchronizationObject );
// Flush threaded logs, but use the safe version.
UnsynchronizedFlushThreadedLogs( false );
// Flush devices.
for (int32 OutputDeviceIndex = 0; OutputDeviceIndex<OutputDevices.Num(); OutputDeviceIndex++)
{
FOutputDevice* OutputDevice = OutputDevices[OutputDeviceIndex];
if (OutputDevice->CanBeUsedOnAnyThread())
{
OutputDevice->Flush();
}
}
BufferedLines.Empty();
}