src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp
changeset 59249 29b0d0b61615
parent 53244 9807daeb47c4
equal deleted inserted replaced
59248:e92153ed8bdc 59249:29b0d0b61615
    90   mutable volatile int _refs;
    90   mutable volatile int _refs;
    91  public:
    91  public:
    92   MultiThreadedRefCounter() : _refs(0) {}
    92   MultiThreadedRefCounter() : _refs(0) {}
    93 
    93 
    94   void inc() const {
    94   void inc() const {
    95     Atomic::add(1, &_refs);
    95     Atomic::add(&_refs, 1);
    96   }
    96   }
    97 
    97 
    98   bool dec() const {
    98   bool dec() const {
    99     return 0 == Atomic::add((-1), &_refs);
    99     return 0 == Atomic::add(&_refs, (-1));
   100   }
   100   }
   101 
   101 
   102   int current() const {
   102   int current() const {
   103    return _refs;
   103    return _refs;
   104   }
   104   }