-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
Hi, it seems that lock device->sync_mutex is missed to be released after 248. In the while loop, the lock could be acquired twice and a deadlock occurs.
Lines 230 to 256 in 1b31ca9
| while (likely(device->running)) { | |
| unsigned i, j; | |
| for (i = 0; i < 6250 / 2; i++) { | |
| for (j = 0; j < 2; j++) { | |
| ai_cycle(&device->ai); | |
| pi_cycle(&device->pi); | |
| } | |
| for (j = 0; j < 3; j++) | |
| vr4300_cycle(device->vr4300); | |
| } | |
| // Sync up with the RCP thread. | |
| cen64_mutex_lock(&device->sync_mutex); | |
| if (!device->other_thread_is_waiting) { | |
| device->other_thread_is_waiting = true; | |
| cen64_cv_wait(&device->sync_cv, &device->sync_mutex); | |
| } | |
| else { | |
| device->other_thread_is_waiting = false; | |
| cen64_mutex_unlock(&device->sync_mutex); | |
| cen64_cv_signal(&device->sync_cv); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
No labels