I am working on a strange bug in our implementation of ArcGIS maps. Recently, I've noticed that our software works properly when I put a breakpoint in certain place and run application in debug mode (probably we are facing concurrency/thread issue). After the breakpoint is hit, I immediately (1-2 seconds) resume application and everything on map draws perfectly. However, when I replace breakpoint with Thread.sleep(2000); and run application, the bug is still there.
To me its really weird, I thought both things would do exactly the same. The breakpoint is set to "Suspend Thread" and I use Eclipse IDE.
What is the difference between put thread to sleep and suspend thread in Java?
EDIT: I don't ask for this specific bug solution. I just want to know what's the difference in execution of program in these two cases:
Case 1
- open Eclipse IDE
- put breakpoint at the line X
- debug as... My Program
- ButtonEvent, program hits breakpoint at line X
- I click on resume button in Eclipse
Case 2
- open Eclipse IDE
- put Thread.sleep(2000) at the very beginning of line X
- debug as... My Program
- ButtonEvent
Pasting code here will make no difference since I am not asking about any particular code execution scenario, I am just only interested whether JVM treats breakpoints in the same way as it treats Thread.sleep(). What is happening in JVM when thread is put to sleep for a particular time? What is happening in JVM when thread is put to suspend (by hitting breakpoint)? Is there any difference?