8232534: Shenandoah: guard against reentrant ShenandoahHeapLock locking
Reviewed-by: rkennke
--- a/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp Thu Oct 17 13:14:48 2019 -0400
+++ b/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp Thu Oct 17 20:56:04 2019 +0200
@@ -41,6 +41,9 @@
ShenandoahLock() : _state(unlocked), _owner(NULL) {};
void lock() {
+#ifdef ASSERT
+ assert(_owner != Thread::current(), "reentrant locking attempt, would deadlock");
+#endif
Thread::SpinAcquire(&_state, "Shenandoah Heap Lock");
#ifdef ASSERT
assert(_state == locked, "must be locked");