def in_main_thread():
 return (threading.current_thread().__class__.__name__ == u'_MainThread')

def in_main_thread ( ) : return ( threading . current_thread ( ) . __class__ . __name__ == u'_MainThread' )
true when the current thread is the main thread .