mutex.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:qudi 作者: Ulm-IQO 项目源码 文件源码
def tryLock(self, timeout=None, id=None):
        """ Try to lock  the mutex.

            @param timeout int: give up after this many milliseconds
            @param id: debug id

            @return bool: whether locking succeeded
        """
        if timeout is None:
            locked = QtCore.QMutex.tryLock(self)
        else:
            locked = QtCore.QMutex.tryLock(self, timeout)

        if self.debug and locked:
            self.l.lock()
            try:
                if id is None:
                    self.tb.append(''.join(traceback.format_stack()[:-1]))
                else:
                    self.tb.append("  " + str(id))
                #print 'trylock', self, len(self.tb)
            finally:
                self.l.unlock()
        return locked
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号