void CMultiThreadReadTest::ThreadRun(IFile *file) { void *block = malloc(m_blocksize); int64_t total_size = 0; WaitStart(); while (m_running) { int ret = file->Read(block, m_blocksize); if (ret <= 0) { NotifyStop(); break; } else { m_bench.Increment(ret); total_size += ret; sched_yield(); } } if (block != NULL) { free(block); } printf("[%u]%" PRId64 "\n", (unsigned)pthread_self(), total_size); }
/////////////////////////////////////////////////////////////////////////////// /// /// Stoppt das Abspielen der Frame-Quelle. /// /////////////////////////////////////////////////////////////////////////////// void BufferedFrameSource::Stop() { isPlaying = false; // Event-Handler informieren NotifyStop(); }