RFR: JDK-8240340: java/lang/management/ThreadMXBean/Locks.java is buggy

Alex Menkov alexey.menkov at oracle.com
Thu Mar 5 00:30:41 UTC 2020


Hi all,

please review the fix for
https://bugs.openjdk.java.net/browse/JDK-8240340
webrev:
http://cr.openjdk.java.net/~amenkov/jdk15/ThreadMXBean_Locks_test/webrev/

changes:
- assertThreadState method: don't re-read thread state throwing 
exception (as we got weird error like "Thread WaitingThread is at 
WAITING state but is expected to be in Thread.State = WAITING");
- added proper test shutdown on error (made all threads "daemon", 
interrupt waiting thread if CheckerThread throws exception);
- if CheckerThread detects error, propagate the exception to main thread;
- fixed LockFreeLogger class - it should work for logging from several 
threads, but it doesn't. I prefer to simplify it just to keep 
ConcurrentLinkedQueue<String>.
LockFreeLogger is also used by ThreadMXBeanStateTest test, but only by a 
single thread.

--alex


More information about the serviceability-dev mailing list