Re: [Twisted-Python] test if thread is reactor's thread

2011-05-11 Thread Alessandro Dentella
thanks to both of you for the hints. My situation is so simple that i guess a twisted.python.threadable.isInIOThread() should suffice. sandro *:-) ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman

Re: [Twisted-Python] test if thread is reactor's thread

2011-05-11 Thread Thomas Hervé
Le 11/05/2011 20:18, Alessandro Dentella a écrit : > Hi, > > > is there a way to test if the thread a function is called is the reactor's > thread? > > I have a function that can be called from the main thread or from the > reactor's thread and should behave differently... Hi, twisted.python.thre

Re: [Twisted-Python] test if thread is reactor's thread

2011-05-11 Thread Jamu Kakar
Hi Alessandro, On Wed, May 11, 2011 at 8:18 PM, Alessandro Dentella wrote: > is there a way to test if the thread a function is called is the reactor's > thread? Yes, you can do it with code like this: from threading import currentThread if currentThread().getName() == 'MainThread': # Code

[Twisted-Python] test if thread is reactor's thread

2011-05-11 Thread Alessandro Dentella
Hi, is there a way to test if the thread a function is called is the reactor's thread? I have a function that can be called from the main thread or from the reactor's thread and should behave differently... thanks sandro *:-) -- Sandro Dentella *:-) http://www.reteisi.org So