I am trying to use objects and threads together and I face a problem. Every object of mine starts a thread. The thread must share one variable with the object's main thread.
When not using objects and you wish to share a variable between threads, you just declare it:
However, when using objects... This doesn't work: