Is sun.misc.Unsafe
or the theUnsafe
instance thread safe?
The methods of Unsafe
are not thread safe. You need to synchronize access to data you want to manipulate yourself - as usual. Accessing the instance theUnsafe
however is, because the field gets initialized when the class is being loaded (it's static).