i’ve downloaded “openjdk-6-src-b23-05_jul_2011” to have a look at the native implementations for the methods in sun.misc.Unsafe. e.g. compareAndSwapInt(…) but i am not able find anything in the downloaded sources of openjdk. i want to get an idea how these methods look like (i was interested in the atomic stuff the jdk provides).
could anybody point me to the right location(s)?
$ ls jdk/src/
linux share solaris windows
$ ls hotspot/src/os/
linux posix solaris windows
any help appreciated
marcel
Implementation of unsafe methods itself is not OS-specific, therefore it can be found in
hotspot/src/share/vm/prims/unsafe.cpp. It delegates tohotspot/src/share/vm/runtime/atomic.cpp, which includes OS and CPU specific files, such ashotspot/src/os_cpu/windows_x86/atomic_windows_x86.inline.hpp.