Commit 4aad4b8 1 parent 223e297 commit 4aad4b8 Copy full SHA for 4aad4b8
File tree 3 files changed +9
-9
lines changed
tests/std/tests/VSO_0226079_mutex
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,18 @@ _EXPORT_STD class condition_variable_any;
32
32
33
33
class _Mutex_base { // base class for all mutex types
34
34
public:
35
- #ifdef _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
35
+ #ifdef _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
36
+ _Mutex_base(int _Flags = 0) noexcept {
37
+ _Mtx_init_in_situ(_Mymtx(), _Flags | _Mtx_try);
38
+ }
39
+ #else // ^^^ defined(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) / !defined(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) vvv
36
40
constexpr _Mutex_base(int _Flags = 0) noexcept {
37
41
_Mtx_storage._Critical_section = {};
38
42
_Mtx_storage._Thread_id = -1;
39
43
_Mtx_storage._Type = _Flags | _Mtx_try;
40
44
_Mtx_storage._Count = 0;
41
45
}
42
- #else // ^^^ _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR / !_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR vvv
43
- _Mutex_base(int _Flags = 0) noexcept {
44
- _Mtx_init_in_situ(_Mymtx(), _Flags | _Mtx_try);
45
- }
46
- #endif // ^^^ !_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR ^^^
46
+ #endif // ^^^ !defined(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) ^^^
47
47
48
48
~_Mutex_base() noexcept {
49
49
_Mtx_destroy_in_situ(_Mymtx());
Original file line number Diff line number Diff line change 3
3
4
4
RUNALL_INCLUDE ..\impure_matrix.lst
5
5
RUNALL_CROSSLIST
6
- * PM_CL="/D_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR "
6
+ * PM_CL="/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR "
7
7
* PM_CL=""
Original file line number Diff line number Diff line change @@ -468,7 +468,7 @@ void test_vso_1253916() {
468
468
do_shared_locked_things (shared_lock<shared_mutex>{mtx});
469
469
}
470
470
471
- #ifdef _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
471
+ #ifndef _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
472
472
struct test_constexpr_ctor {
473
473
constexpr test_constexpr_ctor () {}
474
474
mutex mtx;
@@ -478,7 +478,7 @@ test_constexpr_ctor obj;
478
478
#if _HAS_CXX20 && !defined(_M_CEE)
479
479
constinit test_constexpr_ctor obj2;
480
480
#endif // _HAS_CXX20 && !defined(_M_CEE)
481
- #endif // _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
481
+ #endif // !defined(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
482
482
483
483
int main () {
484
484
{
You can’t perform that action at this time.
0 commit comments