mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8158854: Ensure release_store is paired with load_acquire in lock-free code
Reviewed-by: shade, dcubed, zgu
This commit is contained in:
parent
56ff858c45
commit
6db26ca5bf
10 changed files with 87 additions and 23 deletions
|
@ -50,12 +50,14 @@ class ClassFileStream;
|
|||
|
||||
class ClassPathEntry : public CHeapObj<mtClass> {
|
||||
private:
|
||||
ClassPathEntry* _next;
|
||||
ClassPathEntry* volatile _next;
|
||||
public:
|
||||
// Next entry in class path
|
||||
ClassPathEntry* next() const { return _next; }
|
||||
ClassPathEntry* next() const {
|
||||
return (ClassPathEntry*) OrderAccess::load_ptr_acquire(&_next);
|
||||
}
|
||||
void set_next(ClassPathEntry* next) {
|
||||
// may have unlocked readers, so write atomically.
|
||||
// may have unlocked readers, so ensure visibility.
|
||||
OrderAccess::release_store_ptr(&_next, next);
|
||||
}
|
||||
virtual bool is_jrt() = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue