How to indefinitely pause a thread in Java and later resume it?

前端 未结 3 526
醉梦人生
醉梦人生 2020-12-13 14:52

Maybe this question has been asked many times before, but I never found a satisfying answer.

The problem:


I have to simulate a process s

3条回答
  •  Happy的楠姐
    2020-12-13 15:17

    Yes, there is:

    Object.wait( ), Object.notify() and a bunch of other much nicer synchronization primitives in java.util.concurrent.

提交回复
热议问题