Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Unsafe.compareAndExchange for writing to Stable field and array
Using Unsafe.compareAndExchange prevents issues resulting from multiple threads coming across uninitialized VarHandle's typesAndInvokers field and competing to populate the field with their own versions. Using compareAndExchange to populate the typesAndInvokers' MethodHandle table also prevents similar issues when multiple threads come across the same unpopulated slot in the MethodHandle 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