Author: tack
Date: Wed Feb 13 13:22:21 2008
New Revision: 3066

Log:
Don't use a string for kaa.MAINTHREAD, so that @threaded('main') and
@threaded(kaa.MAINTHREAD) are functionally different; better form
for MainThreadCallbacks


Modified:
   trunk/base/src/notifier/decorators.py
   trunk/base/src/notifier/thread.py

Modified: trunk/base/src/notifier/decorators.py
==============================================================================
--- trunk/base/src/notifier/decorators.py       (original)
+++ trunk/base/src/notifier/decorators.py       Wed Feb 13 13:22:21 2008
@@ -41,7 +41,7 @@
 from timer import Timer
 from kaa.weakref import weakref
 
-MAINTHREAD = 'main'
+MAINTHREAD = object()
 POLICY_ONCE = 'once'
 POLICY_MANY = 'many'
 POLICY_RESTART = 'restart'
@@ -130,7 +130,7 @@
     def decorator(func):
 
         def newfunc(*args, **kwargs):
-            if name == MAINTHREAD:
+            if name is MAINTHREAD:
                 if not async and is_mainthread():
                     # Fast-path case: mainthread synchronous call from the 
mainthread
                     return func(*args, **kwargs)

Modified: trunk/base/src/notifier/thread.py
==============================================================================
--- trunk/base/src/notifier/thread.py   (original)
+++ trunk/base/src/notifier/thread.py   Wed Feb 13 13:22:21 2008
@@ -102,9 +102,9 @@
         if self._callback is None:
             return None
         try:
-            MainThreadCallback(self.finished, self._callback())()
+            MainThreadCallback(self.finished)(self._callback())
         except:
-            MainThreadCallback(self.throw, *sys.exc_info())()
+            MainThreadCallback(self.throw)(*sys.exc_info())
         self._callback = None
 
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to