mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2025-07-02 23:35:26 +08:00
Enhance the documentation and add markdown lint
- Add npm package.json to make easier maintaining dependencies. - Make markdown files consistent using remark. - Wrap markdown lines to 100 characters. - Better README.md layout and visual. - Enable VuePress landing/home page. - Upgrade to latest VuePress version. - Add link to the new Qt Marketplace.
This commit is contained in:
@ -1,7 +1,12 @@
|
||||
# Thread-Safety
|
||||
|
||||
QPromise is thread-safe and can be copied and accessed across different threads. QPromise relies on [explicitly data sharing](https://doc.qt.io/qt-5/qexplicitlyshareddatapointer.html#details) and thus `auto p2 = p1` represents the same promise: when `p1` resolves, handlers registered on `p1` and `p2` are called, the fulfilled value being shared between both instances.
|
||||
QPromise is thread-safe and can be copied and accessed across different threads. QPromise relies on
|
||||
[explicitly data sharing](https://doc.qt.io/qt-5/qexplicitlyshareddatapointer.html#details) and thus
|
||||
`auto p2 = p1` represents the same promise: when `p1` resolves, handlers registered on `p1` and `p2`
|
||||
are called, the fulfilled value being shared between both instances.
|
||||
|
||||
::: warning IMPORTANT
|
||||
While it's safe to access the resolved value from different threads using [`then`](qpromise/then.md), QPromise provides no guarantee about the object being pointed to. Thread-safety and reentrancy rules for that object still apply.
|
||||
While it's safe to access the resolved value from different threads using [`then`](qpromise/then.md),
|
||||
QPromise provides no guarantee about the object being pointed to. Thread-safety and reentrancy rules
|
||||
for that object still apply.
|
||||
:::
|
||||
|
Reference in New Issue
Block a user