in reply to is ||= threadsafe?
Since this is a 'test & set',
It certainly isn't implemented using an atomic instruction, so yes. If $PageQueue is a shared variable, and the statement is part of a thread function body that may be instantiated more than once, you need to lock it before setting it.
|
|---|