예제 #1
0
 def __init__(self, group = None, target = None, name = None, args = (), kwargs = {}):
     self.target = target
     if name is None:
         self.name = 'Tasklet-%d' % Thread.nTasklet
         Thread.nTasklet += 1
     else:
         self.name = name
     self.args, self.kwargs = args, kwargs
     self._join = Event()
     set_channel_pref(self._join)
     self._started = False
     self._alive = False
     self.ident = None
     self._daemon = self._set_daemon()
예제 #2
0
 def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
     self.target = target
     if name is None:
         self.name = "Tasklet-%d"%(Thread.nTasklet)
         Thread.nTasklet += 1
     else:
         self.name = name
     self.args, self.kwargs = args, kwargs
     self._join = Event()
     set_channel_pref(self._join)
     self._started = False
     self._alive = False
     self.ident = None
     self._daemon = self._set_daemon()