It happens internally in the perl code, which is guaranteed to be thread safe
||= happens in Perl code, yet it's not thread safe for shared variables.
You may say that's because it's the user requesting a change the variable, but that's the case for all the examples I showed too.
Now, tye and BrowserUk say the shared SV is appropriately locked internally when updated (and I believe it to be true), so that eliminates the potential problems I posited, so the point is simply that your guarantee is worthless as formulated.
That's probably because you pulled the guarantee out of this air. When I looked this up some time ago, I couldn't find any documentation on this. A very quick look still shows nothing. This is why I prompted for replies on the subject.
Update: Added everything after first line.
Update: Added "for shared variables" in response to reply.
In reply to Re^3: is ||= threadsafe?
by ikegami
in thread is ||= threadsafe?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |