def getInternalQueue(self, thread_id):
        """ returns intenal command queue for a given thread.
        if new queue is created, notify the RDB about it """
        try:
            return self.cmdQueue[thread_id]
        except __HOLE__:
            self.internalQueueLock.acquire()
            try:
                self.cmdQueue[thread_id] = PydevQueue.Queue()
                all_threads = threading.enumerate()
                cmd = None
                for t in all_threads:
                    if GetThreadId(t) == thread_id:
                        if not hasattr(t, 'additionalInfo'):
                            #see http://sourceforge.net/tracker/index.php?func=detail&aid=1955428&group_id=85796&atid=577329
                            #Let's create the additional info right away!
                            t.additionalInfo = PyDBAdditionalThreadInfo()
                            
                        self.RUNNING_THREAD_IDS[thread_id] = t
                        cmd = self.cmdFactory.makeThreadCreatedMessage(t)
                        break
                        
                if cmd:
                    PydevdLog(2, "found a new thread ", str(thread_id))
                    self.writer.addCommand(cmd)
                else:
                    PydevdLog(0, "could not find thread by id to register")
            finally:
                self.internalQueueLock.release()
                
        return self.cmdQueue[thread_id]
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/common/diagnostic/pydevDebug/pydevd.py/PyDB.getInternalQueue