Hi,all:
Given:
Primitives don't have locks and therefore can not be used to synchronize threads. Here
String s is used for synchronize as a lock.
String instance itself is shared between the two threads and therefore the lock on the String is also shared between the two threads. The shared lock on the shared String literal will provide effective synchronization.
What is the
share relationship here?
Thanks,
Roger
[ September 04, 2003: Message edited by: Roger Zhao ]