I have code in scala that, for various reasons, has several lines of code that cannot be accessed by more threads at once.
How easy is it to make it thread safe? I know that I can use the Actors model, but I find it too redundant for a few lines of code.
I would use some kind of lock, but I can not find specific examples in either google or StackOverflow.
source share