Skip to content

Commit 4ed3088

Browse files
committed
Remove 'thread safe assertions' from limitations.md
We now provide thread safe assertions as a configuration option.
1 parent bdc634e commit 4ed3088

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

docs/limitations.md

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,40 +57,6 @@ again.
5757
## Features
5858
This section outlines some missing features, what is their status and their possible workarounds.
5959

60-
### Thread safe assertions
61-
Catch2's assertion macros are not thread safe. This does not mean that
62-
you cannot use threads inside Catch's test, but that only single thread
63-
can interact with Catch's assertions and other macros.
64-
65-
This means that this is ok
66-
```cpp
67-
std::vector<std::thread> threads;
68-
std::atomic<int> cnt{ 0 };
69-
for (int i = 0; i < 4; ++i) {
70-
threads.emplace_back([&]() {
71-
++cnt; ++cnt; ++cnt; ++cnt;
72-
});
73-
}
74-
for (auto& t : threads) { t.join(); }
75-
REQUIRE(cnt == 16);
76-
```
77-
because only one thread passes the `REQUIRE` macro and this is not
78-
```cpp
79-
std::vector<std::thread> threads;
80-
std::atomic<int> cnt{ 0 };
81-
for (int i = 0; i < 4; ++i) {
82-
threads.emplace_back([&]() {
83-
++cnt; ++cnt; ++cnt; ++cnt;
84-
CHECK(cnt == 16);
85-
});
86-
}
87-
for (auto& t : threads) { t.join(); }
88-
REQUIRE(cnt == 16);
89-
```
90-
91-
We currently do not plan to support thread-safe assertions.
92-
93-
9460
### Process isolation in a test
9561
Catch does not support running tests in isolated (forked) processes. While this might in the future, the fact that Windows does not support forking and only allows full-on process creation and the desire to keep code as similar as possible across platforms, mean that this is likely to take significant development time, that is not currently available.
9662

@@ -187,5 +153,5 @@ but only when compiled with a C++20 conforming compiler. MSVC is currently
187153
not conformant enough, but `clang-cl` will compile the assertion above
188154
using MSVC STL without problem.
189155
190-
This change got in with MSVC v19.37](https://godbolt.org/z/KG9obzdvE).
156+
[This change got in with MSVC v19.37](https://godbolt.org/z/KG9obzdvE).
191157

0 commit comments

Comments
 (0)