当前位置: 首页>>代码示例>>C++>>正文


C++ BlockingLoop::Wait方法代码示例

本文整理汇总了C++中common::BlockingLoop::Wait方法的典型用法代码示例。如果您正苦于以下问题:C++ BlockingLoop::Wait方法的具体用法?C++ BlockingLoop::Wait怎么用?C++ BlockingLoop::Wait使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common::BlockingLoop的用法示例。


在下文中一共展示了BlockingLoop::Wait方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SyncGPU

void SyncGPU(SyncGPUReason reason, bool may_move_read_ptr)
{
	if (g_use_deterministic_gpu_thread)
	{
		s_gpu_mainloop.Wait();
		if (!s_gpu_mainloop.IsRunning())
			return;

		// Opportunistically reset FIFOs so we don't wrap around.
		if (may_move_read_ptr && s_fifo_aux_write_ptr != s_fifo_aux_read_ptr)
			PanicAlert("aux fifo not synced (%p, %p)", s_fifo_aux_write_ptr, s_fifo_aux_read_ptr);

		memmove(s_fifo_aux_data, s_fifo_aux_read_ptr, s_fifo_aux_write_ptr - s_fifo_aux_read_ptr);
		s_fifo_aux_write_ptr -= (s_fifo_aux_read_ptr - s_fifo_aux_data);
		s_fifo_aux_read_ptr = s_fifo_aux_data;

		if (may_move_read_ptr)
		{
			u8* write_ptr = s_video_buffer_write_ptr;

			// what's left over in the buffer
			size_t size = write_ptr - s_video_buffer_pp_read_ptr;

			memmove(s_video_buffer, s_video_buffer_pp_read_ptr, size);
			// This change always decreases the pointers.  We write seen_ptr
			// after write_ptr here, and read it before in RunGpuLoop, so
			// 'write_ptr > seen_ptr' there cannot become spuriously true.
			s_video_buffer_write_ptr = write_ptr = s_video_buffer + size;
			s_video_buffer_pp_read_ptr = s_video_buffer;
			s_video_buffer_read_ptr = s_video_buffer;
			s_video_buffer_seen_ptr = write_ptr;
		}
	}
}
开发者ID:BananaMuffinFrenzy,项目名称:dolphin,代码行数:34,代码来源:Fifo.cpp

示例2: FlushGpu

void FlushGpu()
{
	const SConfig& param = SConfig::GetInstance();

	if (!param.bCPUThread || g_use_deterministic_gpu_thread)
		return;

	s_gpu_mainloop.Wait();
}
开发者ID:BananaMuffinFrenzy,项目名称:dolphin,代码行数:9,代码来源:Fifo.cpp


注:本文中的common::BlockingLoop::Wait方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。