Author: remi
Date: 2009-02-10 15:45:45 +0100 (Tue, 10 Feb 2009)
New Revision: 3599

Modified:
   
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDHTTPServer.py
Log:
* improved the threading way to launch the services

Modified: 
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDHTTPServer.py
===================================================================
--- 
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDHTTPServer.py
  2009-02-10 13:52:09 UTC (rev 3598)
+++ 
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDHTTPServer.py
  2009-02-10 14:45:45 UTC (rev 3599)
@@ -82,6 +82,7 @@
             'name' : name,
             'service_callback' : serviceCallback,
             'sub_services' : [],
+            'mutex' : threading.Lock(),
         }
         
         if baseService == None:
@@ -188,24 +189,28 @@
         
         try:
             self.path = urllib.unquote_plus(self.path)
+            #print self.path
             service, paramStr, id = self.__matchService(tdServices, self.path)
             paramDict = self.__parseParameters(paramStr)
             if id == None:
                 id = -1 
             if service != None:
                 if service['service_callback']:
-                    myMutex.acquire()
+                    #myMutex.acquire()
+                    service['mutex'].acquire()
                     try:
                         ret = service['service_callback'](id, paramDict)
                     except:
-                        myMutex.release()
+                        #myMutex.release()
+                        service['mutex'].release()
                         self.__logger = SimpleLogger("tuxhttpserver_resources")
                         self.__logger.setLevel(LOG_LEVEL_DEBUG)
                         self.__logger.setTarget(LOG_TARGET_BOTH)
                         self.__logger.logError("Bugged service : (%s)" % 
self.path)
                         self.__logger.logError(formatException())
                         return None, None
-                    myMutex.release()
+                    #myMutex.release()
+                    service['mutex'].release()
                     return ret
             else:
                 self.__logger = SimpleLogger("tuxhttpserver")


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to