Fix thread hang
- Primary problem was ScopedThreadListLock was releasing heap lock in constructor instead of destructor
- Secondary problem was ScopedThreadListLock should not be used with Mutex::Wait
- Added Thread.getStackTrace case to ThreadStress that reproduces YouTube problem
- Added Mutex::GetDepth and related methods that were useful in diagnoising this issue
Change-Id: I1bdc7245e9b411378b98f4dcf498ad66eb96366d
diff --git a/test/ThreadStress/ThreadStress.java b/test/ThreadStress/ThreadStress.java
index 1f8fb2d..5389c20 100644
--- a/test/ThreadStress/ThreadStress.java
+++ b/test/ThreadStress/ThreadStress.java
@@ -31,7 +31,8 @@
enum Operation {
OOM(1),
SIGQUIT(19),
- ALLOC(80),
+ ALLOC(60),
+ STACKTRACE(20),
EXIT(50),
WAIT(50);
@@ -231,6 +232,10 @@
}
break;
}
+ case STACKTRACE: {
+ Thread.currentThread().getStackTrace();
+ break;
+ }
default: {
throw new AssertionError(operation.toString());
}