I have some runnable code that is executed through a thread.The thread is executed by multiple pieces of code how can I make sure there is only one thread that executes that runnable at a certain point.
I tried using a boolean value that is true on thread start and becomes false at thread end but that didn’t help.
Any ideas?
1 Answer