mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-22 02:39:05 +02:00
softgpu: Avoid thread ordering hazard.
Must run the primitives in the right order. No shortcutting allowed.
This commit is contained in:
1 parent
970e9c2f51
commit
dffc333120
3 files changed
+5
-4
No files matched your search
@@ -258,13 +258,13 @@ void ThreadManager::EnqueueTask(Task *task) {
|
||||
chosenThread->cond.notify_one();
|
||||
}
|
||||
|
||||
void ThreadManager::EnqueueTaskOnThread(int threadNum, Task *task) {
|
||||
void ThreadManager::EnqueueTaskOnThread(int threadNum, Task *task, bool enforceSequence) {
|
||||
_assert_msg_(threadNum >= 0 && threadNum < (int)global_->threads_.size(), "Bad threadnum or not initialized");
|
||||
ThreadContext *thread = global_->threads_[threadNum];
|
||||
|
||||
// Try first atomically, as highest priority.
|
||||
Task *expected = nullptr;
|
||||
bool queued = thread->private_single.compare_exchange_weak(expected, task);
|
||||
bool queued = !enforceSequence && thread->private_single.compare_exchange_weak(expected, task);
|
||||
// Whether we got that or will have to wait, increase the queue counter.
|
||||
thread->queue_size++;
|
||||
|
||||
|
||||
Reference in new issue
Block a user