1 /* |
1 /* |
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2016, 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. |
1318 // to acquire, then deadlock avoidance rules require that the rank |
1318 // to acquire, then deadlock avoidance rules require that the rank |
1319 // of m2 be less than the rank of m1. |
1319 // of m2 be less than the rank of m1. |
1320 // The rank Mutex::native is an exception in that it is not subject |
1320 // The rank Mutex::native is an exception in that it is not subject |
1321 // to the verification rules. |
1321 // to the verification rules. |
1322 // Here are some further notes relating to mutex acquisition anomalies: |
1322 // Here are some further notes relating to mutex acquisition anomalies: |
1323 // . under Solaris, the interrupt lock gets acquired when doing |
|
1324 // profiling, so any lock could be held. |
|
1325 // . it is also ok to acquire Safepoint_lock at the very end while we |
1323 // . it is also ok to acquire Safepoint_lock at the very end while we |
1326 // already hold Terminator_lock - may happen because of periodic safepoints |
1324 // already hold Terminator_lock - may happen because of periodic safepoints |
1327 if (this->rank() != Mutex::native && |
1325 if (this->rank() != Mutex::native && |
1328 this->rank() != Mutex::suspend_resume && |
1326 this->rank() != Mutex::suspend_resume && |
1329 locks != NULL && locks->rank() <= this->rank() && |
1327 locks != NULL && locks->rank() <= this->rank() && |
1330 !SafepointSynchronize::is_at_safepoint() && |
1328 !SafepointSynchronize::is_at_safepoint() && |
1331 this != Interrupt_lock && this != ProfileVM_lock && |
|
1332 !(this == Safepoint_lock && contains(locks, Terminator_lock) && |
1329 !(this == Safepoint_lock && contains(locks, Terminator_lock) && |
1333 SafepointSynchronize::is_synchronizing())) { |
1330 SafepointSynchronize::is_synchronizing())) { |
1334 new_owner->print_owned_locks(); |
1331 new_owner->print_owned_locks(); |
1335 fatal("acquiring lock %s/%d out of order with lock %s/%d -- " |
1332 fatal("acquiring lock %s/%d out of order with lock %s/%d -- " |
1336 "possible deadlock", this->name(), this->rank(), |
1333 "possible deadlock", this->name(), this->rank(), |