src/share/vm/oops/constantPool.hpp

changeset 4984
c115fac239eb
parent 4983
15a99ca4ee34
child 5097
92ef81e2f571
     1.1 --- a/src/share/vm/oops/constantPool.hpp	Thu Apr 25 03:58:53 2013 -0700
     1.2 +++ b/src/share/vm/oops/constantPool.hpp	Thu Apr 25 12:55:49 2013 -0700
     1.3 @@ -111,7 +111,6 @@
     1.4      int                _version;
     1.5    } _saved;
     1.6  
     1.7 -  Monitor*             _lock;
     1.8  
     1.9    void set_tags(Array<u1>* tags)               { _tags = tags; }
    1.10    void tag_at_put(int which, jbyte t)          { tags()->at_put(which, t); }
    1.11 @@ -823,8 +822,17 @@
    1.12  
    1.13    void set_resolved_reference_length(int length) { _saved._resolved_reference_length = length; }
    1.14    int  resolved_reference_length() const  { return _saved._resolved_reference_length; }
    1.15 -  void set_lock(Monitor* lock)            { _lock = lock; }
    1.16 -  Monitor* lock()                         { return _lock; }
    1.17 +
    1.18 +  // lock() may return null -- constant pool updates may happen before this lock is
    1.19 +  // initialized, because the _pool_holder has not been fully initialized and
    1.20 +  // has not been registered into the system dictionary. In this case, no other
    1.21 +  // thread can be modifying this constantpool, so no synchronization is
    1.22 +  // necessary.
    1.23 +  //
    1.24 +  // Use cplock() like this:
    1.25 +  //    oop cplock = cp->lock();
    1.26 +  //    ObjectLocker ol(cplock , THREAD, cplock != NULL);
    1.27 +  oop lock();
    1.28  
    1.29    // Decrease ref counts of symbols that are in the constant pool
    1.30    // when the holder class is unloaded

mercurial