线程类

这些 Qt Core类为应用程序提供线程支持。Qt 中的线程支持页面介绍了如何使用这些类。

Concurrent Filter and Filter-Reduce

并行地从序列中选择值并组合它们

Concurrent Map and Map-Reduce

并行地从序列中转换值并组合它们

Concurrent Run

在单独线程中运行任务的简单方法

Concurrent Task

在独立线程中运行任务的可配置方式

QAtomicInteger

独立于平台的整数原子操作

QAtomicPointer

对指针进行独立于平台的原子运算的模板类

QFuture

代表异步计算的结果

QFutureSynchronizer

简化 QFuture 同步的便利类

QFutureWatcher

允许使用信号和插槽监控 QFuture

QMutex

线程间的访问序列化

QMutexLocker

简化锁定和解锁互斥的便利类

QPromise

存储 QFuture 可访问的计算结果的方法

QReadLocker

简化读取访问的读写锁锁定和解锁的便利类

QReadWriteLock

读写锁

QRecursiveMutex

线程间的访问序列化

QRunnable

所有可运行对象的基类

QSemaphore

通用计数信号

QSemaphoreReleaser

以异常安全方式延迟调用 QSemaphore::release()

QThread

与平台无关的线程管理方式

QThreadPool

管理 QThreads 集合

QThreadStorage

每线程数据存储

QWaitCondition

同步线程的条件变量

QWriteLocker

简化锁定和解锁读写锁(用于写访问)的便利类

QtConcurrent

高级应用程序接口,无需使用低级线程原语即可编写多线程程序

QtConcurrent::QTaskBuilder

用于调整任务参数

QtFuture::WhenAnyResult

QtFuture::WhenAnyResult 用于表示 QtFuture::whenAny() 的结果。

QAtomicInteger::qYieldCpu()

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.