i need to synchronize a method, but actually only part of it needs to be locked, so i wanted to use {} synchornization instead of freezing the whole method.
I thought that the syntax was the following:
synchronized {
//code
}
but it doesnt compile. apparently, there needs to be something in () brackets before the {}
Can anyone clarify what exactly I'm supposed to put there and what's the purpose of that Thanks.
Avendeval
I thought that the syntax was the following:
synchronized {
//code
}
but it doesnt compile. apparently, there needs to be something in () brackets before the {}
Can anyone clarify what exactly I'm supposed to put there and what's the purpose of that Thanks.
Avendeval