9ccdfb
diff -up ./esc/coreconf/Linux3.3.mk.fix14 ./esc/coreconf/Linux3.3.mk
9ccdfb
--- ./esc/coreconf/Linux3.3.mk.fix14	2012-05-10 15:09:37.298143842 -0700
9ccdfb
+++ ./esc/coreconf/Linux3.3.mk	2012-05-10 15:09:37.298143842 -0700
9ccdfb
@@ -0,0 +1,35 @@
9ccdfb
+# BEGIN COPYRIGHT BLOCK
9ccdfb
+# This Program is free software; you can redistribute it and/or modify it under
9ccdfb
+# the terms of the GNU General Public License as published by the Free Software
9ccdfb
+# Foundation; version 2 of the License.
9ccdfb
+#
9ccdfb
+# This Program is distributed in the hope that it will be useful, but WITHOUT
9ccdfb
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9ccdfb
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9ccdfb
+#
9ccdfb
+# You should have received a copy of the GNU General Public License along with
9ccdfb
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
9ccdfb
+# Place, Suite 330, Boston, MA 02111-1307 USA.
9ccdfb
+#
9ccdfb
+# Copyright (C) 2005 Red Hat, Inc.
9ccdfb
+# All rights reserved.
9ccdfb
+# END COPYRIGHT BLOCK
9ccdfb
+
9ccdfb
+#
9ccdfb
+# Config stuff for Linux 3.3 (ELF)
9ccdfb
+#
9ccdfb
+
9ccdfb
+include $(CORE_DEPTH)/coreconf/Linux.mk
9ccdfb
+
9ccdfb
+OS_REL_CFLAGS   += -DLINUX2_1
9ccdfb
+MKSHLIB         = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
9ccdfb
+ifdef BUILD_OPT
9ccdfb
+            OPTIMIZER       = -O2
9ccdfb
+endif
9ccdfb
+
9ccdfb
+ifdef MAPFILE
9ccdfb
+	MKSHLIB += -Wl,--version-script,$(MAPFILE)
9ccdfb
+endif
9ccdfb
+PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
9ccdfb
+        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
9ccdfb
+
9ccdfb
diff -up ./esc/coreconf/Linux3.4.mk.fix14 ./esc/coreconf/Linux3.4.mk
9ccdfb
--- ./esc/coreconf/Linux3.4.mk.fix14	2012-05-10 15:09:37.298143842 -0700
9ccdfb
+++ ./esc/coreconf/Linux3.4.mk	2012-05-10 15:09:37.298143842 -0700
9ccdfb
@@ -0,0 +1,35 @@
9ccdfb
+# BEGIN COPYRIGHT BLOCK
9ccdfb
+# This Program is free software; you can redistribute it and/or modify it under
9ccdfb
+# the terms of the GNU General Public License as published by the Free Software
9ccdfb
+# Foundation; version 2 of the License.
9ccdfb
+#
9ccdfb
+# This Program is distributed in the hope that it will be useful, but WITHOUT
9ccdfb
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9ccdfb
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9ccdfb
+#
9ccdfb
+# You should have received a copy of the GNU General Public License along with
9ccdfb
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
9ccdfb
+# Place, Suite 330, Boston, MA 02111-1307 USA.
9ccdfb
+#
9ccdfb
+# Copyright (C) 2005 Red Hat, Inc.
9ccdfb
+# All rights reserved.
9ccdfb
+# END COPYRIGHT BLOCK
9ccdfb
+
9ccdfb
+#
9ccdfb
+# Config stuff for Linux 3.4 (ELF)
9ccdfb
+#
9ccdfb
+
9ccdfb
+include $(CORE_DEPTH)/coreconf/Linux.mk
9ccdfb
+
9ccdfb
+OS_REL_CFLAGS   += -DLINUX2_1
9ccdfb
+MKSHLIB         = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
9ccdfb
+ifdef BUILD_OPT
9ccdfb
+            OPTIMIZER       = -O2
9ccdfb
+endif
9ccdfb
+
9ccdfb
+ifdef MAPFILE
9ccdfb
+	MKSHLIB += -Wl,--version-script,$(MAPFILE)
9ccdfb
+endif
9ccdfb
+PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
9ccdfb
+        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
9ccdfb
+
9ccdfb
diff -up ./esc/coreconf/Linux3.5.mk.fix14 ./esc/coreconf/Linux3.5.mk
9ccdfb
--- ./esc/coreconf/Linux3.5.mk.fix14	2012-05-10 15:09:37.299143830 -0700
9ccdfb
+++ ./esc/coreconf/Linux3.5.mk	2012-05-10 15:09:37.298143842 -0700
9ccdfb
@@ -0,0 +1,35 @@
9ccdfb
+# BEGIN COPYRIGHT BLOCK
9ccdfb
+# This Program is free software; you can redistribute it and/or modify it under
9ccdfb
+# the terms of the GNU General Public License as published by the Free Software
9ccdfb
+# Foundation; version 2 of the License.
9ccdfb
+#
9ccdfb
+# This Program is distributed in the hope that it will be useful, but WITHOUT
9ccdfb
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9ccdfb
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9ccdfb
+#
9ccdfb
+# You should have received a copy of the GNU General Public License along with
9ccdfb
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
9ccdfb
+# Place, Suite 330, Boston, MA 02111-1307 USA.
9ccdfb
+#
9ccdfb
+# Copyright (C) 2005 Red Hat, Inc.
9ccdfb
+# All rights reserved.
9ccdfb
+# END COPYRIGHT BLOCK
9ccdfb
+
9ccdfb
+#
9ccdfb
+# Config stuff for Linux 3.5 (ELF)
9ccdfb
+#
9ccdfb
+
9ccdfb
+include $(CORE_DEPTH)/coreconf/Linux.mk
9ccdfb
+
9ccdfb
+OS_REL_CFLAGS   += -DLINUX2_1
9ccdfb
+MKSHLIB         = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
9ccdfb
+ifdef BUILD_OPT
9ccdfb
+            OPTIMIZER       = -O2
9ccdfb
+endif
9ccdfb
+
9ccdfb
+ifdef MAPFILE
9ccdfb
+	MKSHLIB += -Wl,--version-script,$(MAPFILE)
9ccdfb
+endif
9ccdfb
+PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
9ccdfb
+        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
9ccdfb
+
9ccdfb
diff -up ./esc/src/app/xpcom/Makefile.sdk.fix14 ./esc/src/app/xpcom/Makefile.sdk
9ccdfb
--- ./esc/src/app/xpcom/Makefile.sdk.fix14	2012-05-10 15:09:37.293143904 -0700
9ccdfb
+++ ./esc/src/app/xpcom/Makefile.sdk	2012-05-10 15:25:17.138394220 -0700
9ccdfb
@@ -106,15 +106,14 @@ endif
9ccdfb
 endif
9ccdfb
 
9ccdfb
 ifeq ($(OS_ARCH),Darwin)
9ccdfb
-GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib    -W1,  $(GECKO_SDK_PATH)/lib/libxpcomglue.a -L$(XUL_FRAMEWORK_BIN_PATH) -lnss3 -lssl3 -lsoftokn3 -lplds4 -lplc4 -lnssutil3
9ccdfb
+GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib    -W1,  $(GECKO_SDK_PATH)/lib/libxpcomglue.a -L$(XUL_FRAMEWORK_BIN_PATH) -lnss3 -lssl3 -lsoftokn3 -lplds4 -lplc4 -lnssutil3 
9ccdfb
 endif
9ccdfb
 
9ccdfb
-
9ccdfb
 ifeq ($(OS_ARCH),Linux)
9ccdfb
-CPPFLAGS += -fno-rtti \
9ccdfb
-                -fno-exceptions \
9ccdfb
-                -fshort-wchar -fPIC -std=gnu++0x
9ccdfb
-GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib    $(GECKO_SDK_PATH)/lib/libxpcomglue.a -lnssutil3 -lnss3 -lcrmf -lssl3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl
9ccdfb
+CPPFLAGS += -g -fno-rtti \
9ccdfb
+                -DXPCOM_GLUE_USE_NSPR -fno-exceptions \
9ccdfb
+                -fshort-wchar -fPIC -std=gnu++0x  
9ccdfb
+GECKO_LD_LIBS=-L$(GECKO_SDK_PATH)/lib  -lnssutil3 -lnss3 -lcrmf -lssl3 -lsmime3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl -L$(GECKO_SDK_PATH)/lib -lxpcomglue_s -lxpcom
9ccdfb
 endif
9ccdfb
 
9ccdfb
 ifeq ($(OS_ARCH),WINNT)
9ccdfb
@@ -128,15 +127,15 @@ endif
9ccdfb
 # #include "mozilla-config.h" to each of your .cpp files. 
9ccdfb
 #GECKO_CONFIG_INCLUDE = -include mozilla-config.h 
9ccdfb
 
9ccdfb
-GECKO_DEFINES  = -DXPCOM_GLUE  -DMOZILLA_CLIENT
9ccdfb
+GECKO_DEFINES  = -DXPCOM_GLUE   -DMOZILLA_CLIENT
9ccdfb
 
9ccdfb
 ifdef ESC_VERSION
9ccdfb
 GECKO_DEFINES += -DESC_VERSION=$(ESC_VERSION)
9ccdfb
 endif
9ccdfb
 
9ccdfb
-ifdef GECKO_BIN_PATH
9ccdfb
-GECKO_DEFINES += -DGECKO_BIN_PATH=$(GECKO_BIN_PATH)
9ccdfb
-endif
9ccdfb
+#ifdef GECKO_BIN_PATH
9ccdfb
+#GECKO_DEFINES += -DGECKO_BIN_PATH=$(GECKO_BIN_PATH)
9ccdfb
+#endif
9ccdfb
 
9ccdfb
 NSS_INCLUDE =  /usr/include/nss3
9ccdfb
 NSPR_INCLUDE =  /usr/include/nspr4
9ccdfb
@@ -162,7 +161,7 @@ COOL_LDFLAGS += -lsystemStubs  -framewor
9ccdfb
 endif
9ccdfb
  
9ccdfb
 GECKO_LDFLAGS= -lnspr4 \
9ccdfb
-	-lplds4  -lplc4 -ldl  -lpthread  -Wl -z   \
9ccdfb
+	-lplds4  -lplc4 -ldl  -lpthread   -z   \
9ccdfb
         $(GECKO_LD_LIBS)
9ccdfb
 
9ccdfb
 ifeq ($(OS_ARCH),WINNT)
9ccdfb
@@ -215,7 +214,7 @@ ifeq ($(OS_ARCH),Linux)
9ccdfb
 
9ccdfb
 	$(CXX)   $(CPPFLAGS) -shared -o $(TARGET) $(OBJECT)  $(GECKO_DEFINES) $(GECKO_INCLUDES)  $(GECKO_LDFLAGS) $(COOL_LDFLAGS)
9ccdfb
 	chmod +x $(TARGET)
9ccdfb
-	strip $(TARGET)
9ccdfb
+	#strip $(TARGET)
9ccdfb
 endif
9ccdfb
 
9ccdfb
 ifeq ($(OS_ARCH),WINNT)
9ccdfb
diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix14 ./esc/src/app/xpcom/rhCoolKey.cpp
9ccdfb
--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix14	2012-05-10 15:09:37.294143891 -0700
9ccdfb
+++ ./esc/src/app/xpcom/rhCoolKey.cpp	2012-05-10 15:09:37.300143818 -0700
9ccdfb
@@ -16,7 +16,6 @@
9ccdfb
  * END COPYRIGHT BLOCK **/
9ccdfb
 
9ccdfb
 #define FORCE_PR_LOG 1
9ccdfb
-
9ccdfb
 #include <stdio.h>
9ccdfb
 #include "rhCoolKey.h"
9ccdfb
 #include "CoolKey.h"
9ccdfb
@@ -34,7 +33,7 @@
9ccdfb
 #include "nsIPrefBranch.h"
9ccdfb
 #include "nsIPrefService.h"
9ccdfb
 #include "nsCOMPtr.h"
9ccdfb
-#include "nsIProxyObjectManager.h"
9ccdfb
+#include "nsThreadUtils.h"
9ccdfb
 #include "nsIObserver.h"
9ccdfb
 #include "nsIObserverService.h"
9ccdfb
 #include "nsXPCOMGlue.h"
9ccdfb
@@ -91,6 +90,7 @@ std::list<CoolKeyNode*>rhCoolKey::gASCAv
9ccdfb
 std::list< nsCOMPtr <rhIKeyNotify>  > rhCoolKey::gNotifyListeners;
9ccdfb
 
9ccdfb
 PRLock* rhCoolKey::certCBLock=NULL;
9ccdfb
+PRLock* rhCoolKey::eventLock= NULL;
9ccdfb
 
9ccdfb
 PRBool rhCoolKey::gAutoEnrollBlankTokens = PR_FALSE; 
9ccdfb
 
9ccdfb
@@ -162,6 +162,70 @@ ASCCalcBase64DecodedLength(const char *a
9ccdfb
 
9ccdfb
   return ((numValidChars / 4) * 3) - numEqualSigns;
9ccdfb
 }
9ccdfb
+class CoolKeyResultTask  : public  nsRunnable
9ccdfb
+{
9ccdfb
+public:
9ccdfb
+  ~CoolKeyResultTask() {
9ccdfb
+
9ccdfb
+      char tBuff[56];
9ccdfb
+      PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s ~CoolKeyResultTask thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread()));
9ccdfb
+
9ccdfb
+      if (mKeyID) {
9ccdfb
+          free(mKeyID);
9ccdfb
+      }
9ccdfb
+
9ccdfb
+      if (mStrData) {
9ccdfb
+          free(mStrData);
9ccdfb
+      }
9ccdfb
+
9ccdfb
+  }
9ccdfb
+
9ccdfb
+  CoolKeyResultTask(unsigned long keyType, const char *keyID, unsigned long keyState,
9ccdfb
+                    unsigned long data, const char *strData, rhICoolKey *listener)
9ccdfb
+    : mKeyType(keyType), mKeyState(keyState), 
9ccdfb
+      mData(data), mListener(listener)
9ccdfb
+  {
9ccdfb
+
9ccdfb
+     mStrData = NULL;
9ccdfb
+     mKeyID   = NULL;
9ccdfb
+
9ccdfb
+     MOZ_ASSERT(!NS_IsMainThread());
9ccdfb
+     
9ccdfb
+     if (keyID) {
9ccdfb
+         mKeyID = strdup(keyID);
9ccdfb
+     }
9ccdfb
+
9ccdfb
+     if (strData) {
9ccdfb
+         mStrData = strdup(strData);
9ccdfb
+     }
9ccdfb
+
9ccdfb
+     char tBuff[56];
9ccdfb
+
9ccdfb
+     PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyResultTask::CoolKeyResultTask thread:   %p keyID %s \n",GetTStamp(tBuff,56),PR_GetCurrentThread(),mKeyID));
9ccdfb
+
9ccdfb
+  }
9ccdfb
+
9ccdfb
+
9ccdfb
+  NS_IMETHOD Run() {
9ccdfb
+    MOZ_ASSERT(NS_IsMainThread());
9ccdfb
+
9ccdfb
+     char tBuff[56];
9ccdfb
+     PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyResultTask::Run thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread()));
9ccdfb
+   
9ccdfb
+     if (mListener != NULL) {
9ccdfb
+         mListener->RhNotifyKeyStateChange(mKeyType, mKeyID, mKeyState, 
9ccdfb
+                        mData, mStrData);
9ccdfb
+     } 
9ccdfb
+   }
9ccdfb
+
9ccdfb
+private: 
9ccdfb
+   unsigned long mKeyType;
9ccdfb
+   char *mKeyID;
9ccdfb
+   unsigned long mKeyState;
9ccdfb
+   unsigned long mData;
9ccdfb
+   char *mStrData; 
9ccdfb
+   rhICoolKey *mListener;
9ccdfb
+};
9ccdfb
 
9ccdfb
 unsigned int
9ccdfb
 ASCCalcBase64EncodedLength(unsigned int aDataLength)
9ccdfb
@@ -200,6 +264,14 @@ rhCoolKey::rhCoolKey()
9ccdfb
         exit(1);
9ccdfb
     }
9ccdfb
 
9ccdfb
+    eventLock = PR_NewLock();
9ccdfb
+
9ccdfb
+    if(!eventLock) {
9ccdfb
+       PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Failed to create event lock exiting! \n", GetTStamp(tBuff,56)));
9ccdfb
+       exit(1);
9ccdfb
+    }
9ccdfb
+
9ccdfb
+
9ccdfb
     PRBool res = InitInstance();
9ccdfb
 
9ccdfb
     if(res == PR_FALSE)
9ccdfb
@@ -221,6 +293,10 @@ rhCoolKey::~rhCoolKey()
9ccdfb
     if(certCBLock) {
9ccdfb
         PR_DestroyLock(certCBLock);
9ccdfb
     }
9ccdfb
+
9ccdfb
+    if(eventLock) {
9ccdfb
+        PR_DestroyLock(eventLock);
9ccdfb
+    }
9ccdfb
 }
9ccdfb
 
9ccdfb
 void rhCoolKey::ShutDownInstance()
9ccdfb
@@ -255,8 +331,17 @@ HRESULT rhCoolKey::Dispatch( rhICoolKey
9ccdfb
     unsigned long keyType, const char *keyID, unsigned long keyState,
9ccdfb
     unsigned long data, const char *strData)
9ccdfb
 {
9ccdfb
-    return listener->RhNotifyKeyStateChange(keyType,keyID, keyState, 
9ccdfb
-			data, strData);
9ccdfb
+
9ccdfb
+    char tBuff[56];
9ccdfb
+
9ccdfb
+    PR_Lock(eventLock);
9ccdfb
+    PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::Dispatch: thead:  %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread()));
9ccdfb
+    nsCOMPtr<nsIRunnable>  result = new CoolKeyResultTask(keyType, keyID,keyState, data, strData, listener);
9ccdfb
+
9ccdfb
+    NS_DispatchToMainThread(result);
9ccdfb
+
9ccdfb
+    PR_Unlock(eventLock);
9ccdfb
+    return  1;  
9ccdfb
 }
9ccdfb
 
9ccdfb
 HRESULT rhCoolKey::Reference( rhICoolKey *listener )
9ccdfb
@@ -536,34 +621,6 @@ PRBool rhCoolKey::InitInstance()
9ccdfb
 
9ccdfb
     PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::InitInstance %p \n",GetTStamp(tBuff,56),this));
9ccdfb
 
9ccdfb
-    char xpcom_path[4096];
9ccdfb
-    xpcom_path[0] = 0;
9ccdfb
-/*
9ccdfb
-    static const GREVersionRange greVersion = 
9ccdfb
-    {
9ccdfb
-    "1.9", PR_TRUE,
9ccdfb
-    "9.9", PR_TRUE
9ccdfb
-    };
9ccdfb
-
9ccdfb
-    nsresult rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcom_path, 4096);
9ccdfb
-    if (NS_FAILED(rv)) {
9ccdfb
-        return PR_FALSE;
9ccdfb
-    }
9ccdfb
-
9ccdfb
-*/
9ccdfb
-
9ccdfb
-    char *grePath = (char *) GETSTRING(GECKO_BIN_PATH);
9ccdfb
-
9ccdfb
-    
9ccdfb
-    snprintf(xpcom_path,4096,"%s%s",grePath,"libxpcom.so");
9ccdfb
-
9ccdfb
-    char *lib_name =(char *) XPCOM_LIB_NAME ;
9ccdfb
-
9ccdfb
-  
9ccdfb
-    PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::xpcom_path %s \n",GetTStamp(tBuff,56),xpcom_path)); 
9ccdfb
-
9ccdfb
-    XPCOMGlueStartup("/usr/lib/xulrunner-2/libxpcom.so");
9ccdfb
-
9ccdfb
     nssComponent
9ccdfb
     = do_GetService(PSM_COMPONENT_CONTRACTID); 
9ccdfb
 
9ccdfb
@@ -640,23 +697,8 @@ PRBool rhCoolKey::InitInstance()
9ccdfb
 
9ccdfb
 rhICoolKey* rhCoolKey::CreateProxyObject()
9ccdfb
 {
9ccdfb
-    char tBuff[56];
9ccdfb
-    rhICoolKey *proxyObject = NULL;
9ccdfb
-
9ccdfb
-    PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::CreateProxyObject: \n",GetTStamp(tBuff,56)));
9ccdfb
-
9ccdfb
-    nsCOMPtr<nsIProxyObjectManager> manager =
9ccdfb
-            do_GetService(NS_XPCOMPROXY_CONTRACTID);
9ccdfb
-
9ccdfb
-    PR_ASSERT(manager);
9ccdfb
-
9ccdfb
-
9ccdfb
-    manager->GetProxyForObject(NULL, NS_GET_IID(rhICoolKey), this, NS_PROXY_SYNC | NS_PROXY_ALWAYS, (void**)&proxyObject);
9ccdfb
-
9ccdfb
-    PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::CreateProxyObject: original: %p proxy %p  \n",GetTStamp(tBuff,56),this,proxyObject));
9ccdfb
-
9ccdfb
-    return proxyObject;
9ccdfb
-   
9ccdfb
+    // Now we are using nsRunnable, no more proxy object manager.
9ccdfb
+    return this;
9ccdfb
 }
9ccdfb
 
9ccdfb
 CoolKeyNode* rhCoolKey::GetCoolKeyInfo(unsigned long aKeyType, const char * aKeyID)
9ccdfb
diff -up ./esc/src/app/xpcom/rhCoolKey.h.fix14 ./esc/src/app/xpcom/rhCoolKey.h
9ccdfb
--- ./esc/src/app/xpcom/rhCoolKey.h.fix14	2012-05-10 15:09:37.274144142 -0700
9ccdfb
+++ ./esc/src/app/xpcom/rhCoolKey.h	2012-05-10 15:09:37.300143818 -0700
9ccdfb
@@ -120,6 +120,7 @@ protected:
9ccdfb
     static std::list< nsCOMPtr <rhIKeyNotify> > gNotifyListeners;
9ccdfb
 
9ccdfb
     static PRLock* certCBLock;
9ccdfb
+    static PRLock* eventLock;
9ccdfb
 
9ccdfb
     rhICoolKey* mProxy;
9ccdfb
 
9ccdfb
diff -up ./esc/src/app/xul/esc/application.ini.fix14 ./esc/src/app/xul/esc/application.ini
9ccdfb
--- ./esc/src/app/xul/esc/application.ini.fix14	2012-05-10 15:09:37.295143878 -0700
9ccdfb
+++ ./esc/src/app/xul/esc/application.ini	2012-05-10 15:09:37.300143818 -0700
9ccdfb
@@ -25,11 +25,11 @@ Vendor=RedHat
9ccdfb
 Name=ESC
9ccdfb
 ;
9ccdfb
 ; This field specifies your application's version.  This field is optional.
9ccdfb
-Version=1.1.0-15
9ccdfb
+Version=1.1.0-16
9ccdfb
 ;
9ccdfb
 ; This field specifies your application's build ID (timestamp).  This field is
9ccdfb
 ; required.
9ccdfb
-BuildID=0000001016
9ccdfb
+BuildID=0000001017
9ccdfb
 ;
9ccdfb
 ; This ID is just an example.  Every XUL app ought to have it's own unique ID.
9ccdfb
 ; You can use the microsoft "guidgen" or "uuidgen" tools, or go on
9ccdfb
diff -up ./esc/src/app/xul/esc/chrome/content/esc/password.xul.fix14 ./esc/src/app/xul/esc/chrome/content/esc/password.xul
9ccdfb
--- ./esc/src/app/xul/esc/chrome/content/esc/password.xul.fix14	2012-05-10 15:09:37.251144429 -0700
9ccdfb
+++ ./esc/src/app/xul/esc/chrome/content/esc/password.xul	2012-05-10 15:09:37.301143805 -0700
9ccdfb
@@ -27,7 +27,6 @@
9ccdfb
 
9ccdfb
 <stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>
9ccdfb
 <script src="password.js"/>
9ccdfb
-<script src="TRAY.js"/>
9ccdfb
 
9ccdfb
 <spacer class = "horSpacerVeryShort"/>
9ccdfb
  <grid>
9ccdfb
diff -up ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix14 ./esc/src/lib/coolkey/CoolKeyHandler.cpp
9ccdfb
--- ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix14	2009-02-03 17:43:47.000000000 -0800
9ccdfb
+++ ./esc/src/lib/coolkey/CoolKeyHandler.cpp	2012-05-10 15:09:37.302143792 -0700
9ccdfb
@@ -451,7 +451,6 @@ HRESULT CoolKeyHandler::Init(const CoolK
9ccdfb
     PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("%s CoolKeyHandler::Init:\n",GetTStamp(tBuff,56)));
9ccdfb
 
9ccdfb
     bool connected = false;
9ccdfb
-    PRThread*  cThread = NULL;
9ccdfb
     const char *readerName =  NULL;
9ccdfb
 
9ccdfb
     if (!aKey || aKey->mKeyType != eCKType_CoolKey ||  !aKey->mKeyID) {
9ccdfb
@@ -461,9 +460,6 @@ HRESULT CoolKeyHandler::Init(const CoolK
9ccdfb
   
9ccdfb
     readerName = GetReaderNameForKeyID(aKey);
9ccdfb
 
9ccdfb
-    cThread = PR_GetCurrentThread();
9ccdfb
-
9ccdfb
-
9ccdfb
     mKey = *aKey;
9ccdfb
 
9ccdfb
   
9ccdfb
diff -up ./esc/src/lib/coolkey/SmartCardMonitoringThread.cpp.fix14 ./esc/src/lib/coolkey/SmartCardMonitoringThread.cpp
9ccdfb
--- ./esc/src/lib/coolkey/SmartCardMonitoringThread.cpp.fix14	2012-05-10 15:09:37.250144442 -0700
9ccdfb
+++ ./esc/src/lib/coolkey/SmartCardMonitoringThread.cpp	2012-05-10 15:09:37.302143792 -0700
9ccdfb
@@ -29,6 +29,9 @@
9ccdfb
 
9ccdfb
 #include <assert.h>
9ccdfb
 #include <time.h>
9ccdfb
+#ifdef LINUX
9ccdfb
+#include <unistd.h>
9ccdfb
+#endif
9ccdfb
 
9ccdfb
 static PRLogModuleInfo *coolKeyLogSC = PR_NewLogModule("coolKeySmart");
9ccdfb