Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

[JAVA] suing synchronized block

temp temp

2007-03-20

Replies:

  I using synchronized block and need help in using it ?
   
   I have a SingleTon class which has a global valriable Map.
   I will updating this Map at runtime.
   
   Example
        synchronized (fActionHandlers) {
   fActionHandlers.put(
      vAction.getClassName(),
      vConfigAction);
}
   I want this update to be synchronized . The above code is this right ?
      My assumption about this is JVM will allow only one thread at a time to execute the code in the synchronized block is this right ?
Thanks & Regards
     
 

---------------------------------
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
©2008 junlu.com - Jax Systems, LLC, U.S.A.