commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From harishksw...@apache.org
Subject cvs commit: jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/hivemind/service/impl ThreadLocalStorageImpl.java
Date Tue, 02 Mar 2004 04:34:00 GMT
harishkswamy    2004/03/01 20:34:00

  Modified:    hivemind/framework/src/java/org/apache/hivemind/service/impl
                        ThreadLocalStorageImpl.java
  Log:
  Modified the INITIALIZED_KEY to reduce the chance of a conflict.
  
  Revision  Changes    Path
  1.3       +6 -5      jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/hivemind/service/impl/ThreadLocalStorageImpl.java
  
  Index: ThreadLocalStorageImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/hivemind/service/impl/ThreadLocalStorageImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ThreadLocalStorageImpl.java	1 Mar 2004 15:32:39 -0000	1.2
  +++ ThreadLocalStorageImpl.java	2 Mar 2004 04:34:00 -0000	1.3
  @@ -29,7 +29,8 @@
    */
   public class ThreadLocalStorageImpl implements ThreadLocalStorage, ThreadCleanupListener
   {
  -    private static final String  INITIALIZED_KEY = "initialized";
  +    private static final String  INITIALIZED_KEY = 
  +        "$org.apache.hivemind.service.impl.ThreadLocalStorageImpl#initialized$";
   
       private CleanableThreadLocal _local          = new CleanableThreadLocal();
       private ThreadEventNotifier  _notifier;
  @@ -43,15 +44,15 @@
            * register the listener with {@link ThreadEventNotifier}.
            * <p>
            * The registration cannot be done from here because it may get lost once the caller
method (
  -         * {@link ThreadLocal#get()} or {@link ThreadLocal#set(java.lang.Object)} completes,
if
  +         * {@link ThreadLocal#get()}or {@link ThreadLocal#set(java.lang.Object)}completes,
if
            * this was the first ThreadLocal variable access for the Thread.
            */
           protected Object initialValue()
           {
               // NOTE: This is a workaround to circumvent the ThreadLocal behavior.
  -            // It would be easier if the implementation of ThreadLocal.get() checked for

  +            // It would be easier if the implementation of ThreadLocal.get() checked for
               // the existence of the thread local map, after initialValue() is evaluated,
  -            // and used it instead of creating a new map always after initialization (possibly

  +            // and used it instead of creating a new map always after initialization (possibly
               // overwriting any variables created from within ThreadLocal.initialValue()).
   
               Map map = new HashMap();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message