equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
1033 |
1033 |
1034 if (TryLock()) { |
1034 if (TryLock()) { |
1035 Exeunt: |
1035 Exeunt: |
1036 assert(ILocked(), "invariant"); |
1036 assert(ILocked(), "invariant"); |
1037 assert(_owner == NULL, "invariant"); |
1037 assert(_owner == NULL, "invariant"); |
1038 // This can potentially be called by non-java Threads. Thus, the ThreadLocalStorage |
1038 // This can potentially be called by non-java Threads. Thus, the Thread::current_or_null() |
1039 // might return NULL. Don't call set_owner since it will break on an NULL owner |
1039 // might return NULL. Don't call set_owner since it will break on an NULL owner |
1040 // Consider installing a non-null "ANON" distinguished value instead of just NULL. |
1040 // Consider installing a non-null "ANON" distinguished value instead of just NULL. |
1041 _owner = ThreadLocalStorage::thread(); |
1041 _owner = Thread::current_or_null(); |
1042 return; |
1042 return; |
1043 } |
1043 } |
1044 |
1044 |
1045 if (TrySpin(NULL)) goto Exeunt; |
1045 if (TrySpin(NULL)) goto Exeunt; |
1046 |
1046 |