예제 #1
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self, interval, function, args=[], kwargs={}):
     Thread.__init__(self)
     self.interval = interval
     self.function = function
     self.args = args
     self.kwargs = kwargs
     self.finished = Event()
예제 #2
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self, interval, function, args=[], kwargs={}):
     Thread.__init__(self)
     self.interval = interval
     self.function = function
     self.args = args
     self.kwargs = kwargs
     self.finished = Event()
예제 #3
0
파일: Threading2.py 프로젝트: kralf/panda3d
    def __init__(self):
        Thread.__init__(self, name=_newname("Dummy-%d"))

        # Thread.__block consumes an OS-level locking primitive, which
        # can never be used by a _DummyThread.  Since a _DummyThread
        # instance is immortal, that's bad, so release this resource.
        del self._Thread__block

        self._Thread__started = True
        _active_limbo_lock.acquire()
        _active[_get_ident()] = self
        _active_limbo_lock.release()
예제 #4
0
파일: Threading2.py 프로젝트: kralf/panda3d
    def __init__(self):
        Thread.__init__(self, name=_newname("Dummy-%d"))

        # Thread.__block consumes an OS-level locking primitive, which
        # can never be used by a _DummyThread.  Since a _DummyThread
        # instance is immortal, that's bad, so release this resource.
        del self._Thread__block

        self._Thread__started = True
        _active_limbo_lock.acquire()
        _active[_get_ident()] = self
        _active_limbo_lock.release()
예제 #5
0
파일: Threading.py 프로젝트: kralf/panda3d
    def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
        ThreadBase.__init__(self)

        assert group is None
        self.__target = target
        self.__args = args
        self.__kwargs = kwargs

        if not name:
            import threading2
            name = threading2._newname()

        current = current_thread()
        self.__dict__['daemon'] = current.daemon
        self.__dict__['name'] = name

        self.__thread = pm.PythonThread(self.run, None, name, name)
        threadId = _thread._add_thread(self.__thread, weakref.proxy(self))
        self.__dict__['ident'] = threadId
예제 #6
0
파일: Threading.py 프로젝트: kralf/panda3d
    def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
        ThreadBase.__init__(self)

        assert group is None
        self.__target = target
        self.__args = args
        self.__kwargs = kwargs

        if not name:
            import threading2
            name = threading2._newname()

        current = current_thread()
        self.__dict__['daemon'] = current.daemon
        self.__dict__['name'] = name

        self.__thread = pm.PythonThread(self.run, None, name, name)
        threadId = _thread._add_thread(self.__thread, weakref.proxy(self))
        self.__dict__['ident'] = threadId
예제 #7
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self, queue, count):
     Thread.__init__(self, name="Consumer")
     self.queue = queue
     self.count = count
예제 #8
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self, queue, quota):
     Thread.__init__(self, name="Producer")
     self.queue = queue
     self.quota = quota
예제 #9
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self):
     Thread.__init__(self, name="MainThread")
     self._Thread__started = True
     _active_limbo_lock.acquire()
     _active[_get_ident()] = self
     _active_limbo_lock.release()
예제 #10
0
파일: Threading.py 프로젝트: kralf/panda3d
def current_thread():
    t = pm.Thread.getCurrentThread()
    return _thread._get_thread_wrapper(t, _create_thread_wrapper)
예제 #11
0
파일: Threading.py 프로젝트: kralf/panda3d
 def __del__(self):
     # On interpreter shutdown, the _thread module might have
     # already been cleaned up.
     if _thread and _thread._remove_thread_id:
         _thread._remove_thread_id(self.ident)
예제 #12
0
파일: Threading.py 프로젝트: kralf/panda3d
def current_thread():
    t = pm.Thread.getCurrentThread()
    return _thread._get_thread_wrapper(t, _create_thread_wrapper)
예제 #13
0
파일: Threading.py 프로젝트: kralf/panda3d
 def __del__(self):
     # On interpreter shutdown, the _thread module might have
     # already been cleaned up.
     if _thread and _thread._remove_thread_id: 
         _thread._remove_thread_id(self.ident)
예제 #14
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self, queue, count):
     Thread.__init__(self, name="Consumer")
     self.queue = queue
     self.count = count
예제 #15
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self, queue, quota):
     Thread.__init__(self, name="Producer")
     self.queue = queue
     self.quota = quota
예제 #16
0
파일: Threading2.py 프로젝트: kralf/panda3d
 def __init__(self):
     Thread.__init__(self, name="MainThread")
     self._Thread__started = True
     _active_limbo_lock.acquire()
     _active[_get_ident()] = self
     _active_limbo_lock.release()