cellAtracXdec: replace shared_mutexes/cond_variables with lv2 mutexes/conds#16549
Conversation
| switch (savestate) | ||
| { | ||
| case atracxdec_state::waiting_for_cmd_mutex_lock: break; | ||
| case atracxdec_state::waiting_for_cmd_cond_wait: goto wait_for_cmd; |
There was a problem hiding this comment.
We don't use goto in rpcs3
There was a problem hiding this comment.
I approve it in this case,
I suggest mentioning where the label literally is:
| case atracxdec_state::waiting_for_cmd_cond_wait: goto wait_for_cmd; | |
| case atracxdec_state::waiting_for_cmd_cond_wait: goto wait_for_cmd_line_305; |
There was a problem hiding this comment.
Just because you approve it personally doesn't make it ok
There was a problem hiding this comment.
He would have to replace it with a huge switch with fallthroughs for each case otherwise, this is not a refactoring pr but a bugfix so I rather let it be fixed first.
There was a problem hiding this comment.
In my opinion gotos is the most intuitive way of handling savestates here. We're simply jumping back to where the thread was interrupted, there aren't any crazy control flow gymnastics.
But if no gotos is a hard requirement, then I'll replace them with a large switch. I'd have to replace the command type switch with an if-else chain though since you can't put cases of one switch in the middle of another.
I disagree on putting the line number on the labels, however. You would have to update them every time the line number changes.
There was a problem hiding this comment.
Maybe not a line number, but I do want unique distinguishing on labels. Perhaps:
| case atracxdec_state::waiting_for_cmd_cond_wait: goto wait_for_cmd; | |
| case atracxdec_state::waiting_for_cmd_cond_wait: goto label2_wait_for_cmd_stage; |
Putting the prefix "label" and relative order number between other labels in the function.
I do want to standardize it for the use of savestates.
8d6862f to
420e653
Compare
Other PPU threads were apparently being blocked from executing while waiting on shared_mutexes/cond_variables.
Should fix #16538