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
Check that silent mode shows nothing, that show mode shows the PSN notice
when Open and Open2 succeed with a valid store parameter, that a null
parameter shows nothing, and that no notice is shown without a presenter.
The guest test links libSceIme.