void AsyncIOManager::DoState(PointerWrap &p) {
	auto s = p.Section("AsyncIoManager", 1, 2);
	if (!s)
		return;

	SyncThread();
	lock_guard guard(resultsLock_);
	p.Do(resultsPending_);
	if (s >= 2) {
		p.Do(results_);
	} else {
		std::map<u32, size_t> oldResults;
		p.Do(oldResults);
		for (auto it = oldResults.begin(), end = oldResults.end(); it != end; ++it) {
			results_[it->first] = AsyncIOResult(it->second);
		}
	}
}
void AsyncIOManager::Write(u32 handle, u8 *buf, size_t bytes) {
	int usec = 0;
	s64 result = pspFileSystem.WriteFile(handle, buf, bytes, usec);
	EventResult(handle, AsyncIOResult(result, usec));
}
Exemple #3
0
void AsyncIOManager::Read(u32 handle, u8 *buf, size_t bytes, u32 invalidateAddr) {
	int usec = 0;
	s64 result = pspFileSystem.ReadFile(handle, buf, bytes, usec);
	EventResult(handle, AsyncIOResult(result, usec, invalidateAddr));
}