Python PyQt5.QtCore 模块,QMutex() 实例源码

我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用PyQt5.QtCore.QMutex()

项目:HearthPacks    作者:Arzaroth    | 项目源码 | 文件源码
def __init__(self):
        QtCore.QThread.__init__(self)
        self.mutex = QtCore.QMutex()
        self.pack_opener = None
        self._isRunning = False
项目:DawnlightSearch    作者:chg-hou    | 项目源码 | 文件源码
def start(self, table_name, sql_insert_queue, sql_insert_mutex, sql_insert_condition):

        # table_name = "dfdfd"
        #
        # sql_insert_queue = Queue.Queue()
        # sql_insert_mutex = QtCore.QMutex()
        # sql_insert_condition = QtCore.QWaitCondition()

        self.rw_lock = QtCore.QReadWriteLock()

        mftsize = (os.path.getsize(self.options.filename)) / 1024
        self.mftsize = mftsize
        filename = self.options.filename

        self.mft_seqs_flag_list = [0] * self.mftsize  # 0 empty, 1 parsering, 2 done.
        self.mft = {}

        self.thread_no = max(1, QtCore.QThread.idealThreadCount())
        self.thread_no = 10  # 1'26''
        self.thread_no = 1  # 1'12''
        printself.thread_no
        self.thread_pool = [MftWorkerThread(self.mft, self.mft_seqs_flag_list, mftsize, filename, self.rw_lock,
                                            sql_insert_queue, sql_insert_mutex, sql_insert_condition,
                                            table_name, self.options,
                                            parent=self.parent) for _ in range(self.thread_no)]

        for thread in self.thread_pool:
            # thread.add_row_to_model_SIGNAL.connect(self.target_slot)
            # thread.update_progress_SIGNAL.connect(self.update_progress_slot)
            thread.start()
项目:plexdesktop    作者:coryo    | 项目源码 | 文件源码
def __init__(self, name, parent=None):
        super().__init__(name, parent)
        self.ui = plexdesktop.ui.downloadwindow_ui.Ui_DownloadWindow()
        self.ui.setupUi(self)

        self.mutex = QtCore.QMutex()

        self.setWindowTitle('Downloads')
        self.setWindowFlags(QtCore.Qt.Window)
        self.spacer = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        self.ui.layout.insertItem(-1, self.spacer)
        self.jobs = {}
        self.queue = queue.Queue()
项目:HearthPacks    作者:Arzaroth    | 项目源码 | 文件源码
def __init__(self, opts):
        QtCore.QThread.__init__(self)
        self.mutex = QtCore.QMutex()
        self.opts = opts
        self.email, self.password = "", ""
        self.anonymous = True
项目:ultimate-tic-tac-toe    作者:stoimenoff    | 项目源码 | 文件源码
def __init__(self, parent):
        super(RequestHandler, self).__init__()
        self.parent = parent
        self.__terminated = False
        self.mutex = QMutex()
        self.waitForClick = QWaitCondition()
项目:Python_SelfLearning    作者:fukuit    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(FileList, self).__init__(parent)
        self.stopped = False
        self.mutex = QMutex()
项目:OpenTutorials_PyQt    作者:RavenKyu    | 项目源码 | 文件源码
def __init__(self, serial):
        QThread.__init__(self)
        self.cond = QWaitCondition()
        self._status = False
        self.mutex = QMutex()
        self.serial = serial
项目:OpenTutorials_PyQt    作者:RavenKyu    | 项目源码 | 文件源码
def __init__(self):
        QThread.__init__(self)
        self.cond = QWaitCondition()
        self.mutex = QMutex()
        self.cnt = 0
        self._status = True