Jstack log thread analysis
There are several kinds of thread stack states:
1 、 NEW
2 、 RUNNABLE
3. Before BLOCKED# enters synchronized
4. WAITING# has entered synchronized and called wait ()
5. TIMED_WAITING# has entered synchronized and called sleep ()
6. TERMINATED# thread ends
Thread lock interpretation:
When a thread holds a lock, the thread stack prints a-locked
When a thread is waiting for another thread to release the lock, the thread stack prints a-waiting to lock
When a thread holds a lock but executes on the lock's wait, the thread stack first prints the locked and then prints-waiting on