< prev index next >
src/share/vm/runtime/mutex.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 1033,1046 ****
if (TryLock()) {
Exeunt:
assert(ILocked(), "invariant");
assert(_owner == NULL, "invariant");
! // This can potentially be called by non-java Threads. Thus, the ThreadLocalStorage
// might return NULL. Don't call set_owner since it will break on an NULL owner
// Consider installing a non-null "ANON" distinguished value instead of just NULL.
! _owner = ThreadLocalStorage::thread();
return;
}
if (TrySpin(NULL)) goto Exeunt;
--- 1033,1046 ----
if (TryLock()) {
Exeunt:
assert(ILocked(), "invariant");
assert(_owner == NULL, "invariant");
! // This can potentially be called by non-java Threads. Thus, the Thread::current()
// might return NULL. Don't call set_owner since it will break on an NULL owner
// Consider installing a non-null "ANON" distinguished value instead of just NULL.
! _owner = Thread::current();
return;
}
if (TrySpin(NULL)) goto Exeunt;
< prev index next >