If you want to do the actual messaging, see SynchronusQueue . Each thread will have a link to the queue and will wait until one thread passes the link through the queue.
It will be thread safe and will meet your requirements.
Although, if you just want the threads to read and write a shared variable, you can use the normalocity clause, although the safety of the threads depends on how you access it (through synchronized or unstable).
source
share