Tell me such a thing. If the program defines an event handler for my event and I launch Thread.sleep(100) , while the program is standing still, can my event come? They are asynchronous?

Thank you in advance.

  • maybe ... - Gorets

1 answer 1

Sleep does not release the lock. So all attempts to call methods that require this lock will be waiting for it to be released.

In general, the question is quite vague. What does "event come" (where)? What does "prog" mean (a specific stream probably all the same)?

  • Thanks for the answer. The problem is solved. I meant that: 1. "The event will come" - the object of the class that defines the event (mine), sends it. 2. "Worth a program" - Yes. The program flow is delayed via Thread.sleep (30,000). And what I had in mind with my question. If the main thread of the program is delayed via Thread.sleep (30,000) for 30 seconds, you guessed it, and before that another thread was launched in which events are created and sent to the main one ( example) a stream, say, every second, whether it will (the main thread) receive them and process (after all, it is delayed by sleep). Answer: yes. I decided to do it with the usual dough - rapa