0

For testing purposes, I want to wake up a thread that is waiting for a scheduling to occur. I have my application in debug mode and identified the thread I want to wake up.

Unsafe.park(boolean, long) line: not available [native method]  
LockSupport.parkNanos(Object, long) line: 215   
AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) line: 2078  
ScheduledThreadPoolExecutor$DelayedWorkQueue.take() line: 1093  
ScheduledThreadPoolExecutor$DelayedWorkQueue.take() line: 809   
ScheduledThreadPoolExecutor(ThreadPoolExecutor).getTask() line: 1067    
ScheduledThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: 1127 
ThreadPoolExecutor$Worker.run() line: 617   
Thread.run() line: 745  

Is it possible to issue anything in Eclipse's Display window from the top of the stack that will pretend the timeout to have past and allow me to debug code that will be executed on callback?

Of course I know what I am doing and I have no responsibility to take, as it is my localhost machine.

Comment. I know I could design my application with a bug huge green test button that can be clicked only by an admin/developer, but I am still asking this for future use

usr-local-ΕΨΗΕΛΩΝ
  • 26,101
  • 30
  • 154
  • 305
  • Just for the record: would it be an option to use a [same thread executor](https://stackoverflow.com/questions/6581188/is-there-an-executorservice-that-uses-the-current-thread) instead of entering *unsafe* territory*? So instead of cheating on some thread waiting for something ... find a (test) solution that doesn't require waiting at all? – GhostCat Sep 01 '17 at 08:34
  • No, this is a web application using Spring massively. I have scheduled a callback and want to test it before the deadline occurs – usr-local-ΕΨΗΕΛΩΝ Sep 01 '17 at 08:36
  • @GhostCat in fact I am in the process of *making the button I mentioned* – usr-local-ΕΨΗΕΛΩΝ Sep 01 '17 at 08:36

0 Answers0