src/share/vm/runtime/objectMonitor.inline.hpp

changeset 4471
22ba8c8ce6a6
parent 2314
f95d63e2154a
child 6876
710a3c8b516e
     1.1 --- a/src/share/vm/runtime/objectMonitor.inline.hpp	Tue Jan 22 05:55:04 2013 -0800
     1.2 +++ b/src/share/vm/runtime/objectMonitor.inline.hpp	Tue Jan 22 05:56:42 2013 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -101,10 +101,12 @@
    1.11    return _count;
    1.12  }
    1.13  
    1.14 +// Do NOT set _count = 0. There is a race such that _count could
    1.15 +// be set while inflating prior to setting _owner
    1.16 +// Just use Atomic::inc/dec and assert 0 when monitor put on free list
    1.17  inline void ObjectMonitor::set_owner(void* owner) {
    1.18    _owner = owner;
    1.19    _recursions = 0;
    1.20 -  _count = 0;
    1.21  }
    1.22  
    1.23  

mercurial