mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-08 13:50:20 +00:00
sceNpSnsFacebookDialogOpen and sceNpSnsFacebookDialogClose read the dialog status, checked it, and then stored FINISHED in a separate step. If another thread called sceNpSnsFacebookDialogTerminate between the read and the store, Terminate returned 0 and set the status to NONE, and then Open or Close wrote FINISHED over it. The library was left looking initialized after it had been terminated: sceNpSnsFacebookDialogGetStatus returned FINISHED and the next sceNpSnsFacebookDialogInitialize failed with ALREADY_INITIALIZED. Open and Close now move the status to FINISHED with a compare-exchange loop that repeats the checks against the value it replaces, so a concurrent Terminate either happens first, making the call return NOT_INITIALIZED, or happens after, leaving the status at NONE. Open still offers the PSN feature notice only after a successful transition. guest_np_sns_facebook_dialog gains two cases that race Open and Close against Terminate for 200000 rounds each and require the status to be NONE after every round. AI-assisted: yes