Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Unsafe.compareAndSwap for writing to Stable field and array
Using Unsafe.compareAndSwap prevents issues resulting from multiple threads coming across uninitialized VarHandle.typesAndInvokers field and competing to populate the field with their own versions. Using compareAndSwap to populate the typesAndInvokers' MethodHandle table also prevents similar issues when multiple threads come across the same unpopulated slot in the table and compete to populate it. Signed-off-by: Nazim Bhuiyan <nubhuiyan@ibm.com> Co-authored-by: Devin Papineau <devin@ajdmp.ca>
- Loading branch information