I realize that my explanation is pretty vague, but along the code snippet it should clear up the question.
There is this method that we use to synchronize access to a map by its key. The key comes from deserializing argument from a remote call of a gwt client. In code:
The thinking behind this is that first you create an object to synchronize a block with intensive processing on. This object is a value of a map to guarantee proper synchronization to guarantee that if two requests with equal but not identical objectToSynchronizeOn come then one of them has wait before the second synchronized block is finished. I am not sure how synchronized keyword operates - does it only stop concurrent thread flow if it wants to obtain lock on the same object (which in case of deserialized requests is not true) or is the fact that two object are equal suffices.
The question is, if i can synchronized on a deserialized object directly without using intermediary map.
To synchronize between threads, you need to synchronize on identical Objects, not just equal Objects. So you will need some sort of Caching mechanism to make sure that you translate equality to identity - so yes you do need that sMap to do what it is doing...