我正在分析一个线程转储,我在状态WAITING(停车)停车时有数百个线程等待< 0x00000005c1c3e0b0>。 现在我期望找到另一个在对象0x00000005c1c3e0b0上有锁的线程,但是没有! 有人对此有解释吗?
注意: 0x00000005c1c3e0b0是java.util.concurrent.locks.ReentrantReadWriteLock $ NonfairSync)
我的理论: 由于我有许多线程等待获取锁定以基本上访问SelectableConcurrentHashMap,我期望有另一个线程执行该SelectableConcurrentHashMap的方法,具有其锁定。我的线程转储中没有。假设我的线程转储是可靠的,我认为解锁方法失败了。在我的情况下,ReentrantReadWriteLock.tryRelease可能失败了(IllegalMonitorStateException?)。 我的日志系统被此锁阻止,所以我没有日志来检查这个。 如果这是真的,我想知道这是怎么发生的。 如果解锁没有失败,因为仍然存在锁定,这意味着线程在获取锁定后仍然会在操作上处于活动状态,但是我无法看到这样的线程。线程转储,因此我认为解锁失败。
等待锁定的线程示例:
INFO | jvm 1 |主要| 2017/10/15 10:41:04.121 | " ThreadExecutor-master-32040-TriggerTask [8796781183926]" #32040 daemon prio = 5 os_prio = 0 tid = 0x00007f73140a8000 nid = 0x712c等待条件[0x00007f72f90e1000] 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | java.lang.Thread.State:WAITING(停车) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 |在sun.misc.Unsafe.park(原生方法) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | - 停车等待< 0x00000005c1c3e0b0> (java.util.concurrent.locks.ReentrantReadWriteLock $ NonfairSync) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:967) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1283) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | at java.util.concurrent.locks.ReentrantReadWriteLock $ ReadLock.lock(ReentrantReadWriteLock.java:727) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | at net.sf.ehcache.store.chm.SelectableConcurrentHashMap $ Segment.get(SelectableConcurrentHashMap.java:721) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 | at net.sf.ehcache.store.chm.SelectableConcurrentHashMap.get(SelectableConcurrentHashMap.java:324) 信息| jvm 1 |主要| 2017/10/15 10:41:04.121 |在net.sf.ehcache.store.MemoryStore.get(MemoryStore.java:326) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 |在net.sf.ehcache.Cache.get(Cache.java:1734) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.localcache.region.impl.ehcacheRegion.getWithLoader(ehcacheRegion.java:308) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.localcache.DefaultCacheController.getWithLoader(DefaultCacheController.java:235) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.cache.impl.localcacheAdapter.getOrAddTemp(localcacheAdapter.java:212) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.tx.Transaction $ GlobalCacheAdapter.getOrAddTemp(Transaction.java:2382) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.cache.AbstractCacheTemp.get(AbstractCacheTemp.java:175) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.Inner.InnerItemCacheTemp.getCached(InnerItemCacheTemp.java:110) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.core.ObjectFactory.getCachedItem(ObjectFactory.java:456) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.Inner.InnerSession.lookupItem(InnerSession.java:1817) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.Inner.InnerSession.getItem(InnerSession.java:1903) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.task.impl.DefaultScheduleService.getScheduledItem(DefaultScheduleService.java:1347) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.task.impl.DefaultScheduleService.doProcess(DefaultScheduleService.java:1398) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.task.impl.DefaultScheduleService.doProcessInSystem(DefaultScheduleService.java:1377) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at it.luca.example.task.impl.DefaultScheduleService $ 5.run(DefaultScheduleService.java:1256) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 |在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 |在java.lang.Thread.run(Thread.java:748) 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 | 信息| jvm 1 |主要| 2017/10/15 10:41:04.122 |