Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions stl/inc/mutex
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ public:
}
#endif // ^^^ !defined(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) ^^^

~_Mutex_base() noexcept {
_Mtx_destroy_in_situ(_Mymtx());
Copy link
Contributor Author

@CaseyCarter CaseyCarter Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be convinced to retain this debug check for ~recursive_mutex, which feels less performance-sensitive to me. Thoughts, comments?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with dropping it.

}

_Mutex_base(const _Mutex_base&) = delete;
_Mutex_base& operator=(const _Mutex_base&) = delete;

Expand Down
1 change: 0 additions & 1 deletion stl/inc/xthreads.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ _CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t*, int) noexcept;
_CRTIMP2_PURE void __cdecl _Mtx_destroy(_Mtx_t) noexcept;
#endif // _CRTBLD
_CRTIMP2_PURE void __cdecl _Mtx_init_in_situ(_Mtx_t, int) noexcept;
_CRTIMP2_PURE void __cdecl _Mtx_destroy_in_situ(_Mtx_t) noexcept;
_CRTIMP2_PURE int __cdecl _Mtx_current_owns(_Mtx_t) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_lock(_Mtx_t) noexcept;
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_trylock(_Mtx_t) noexcept;
Expand Down
2 changes: 2 additions & 0 deletions stl/src/mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ _CRTIMP2_PURE void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int type) noexcept { //
mtx->_Count = 0;
}

// TRANSITION, ABI: preserved for binary compatibility
_CRTIMP2_PURE void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx) noexcept { // destroy mutex in situ
_THREAD_ASSERT(mtx->_Count == 0, "mutex destroyed while busy");
(void) mtx;
Expand All @@ -64,6 +65,7 @@ _CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t* mtx, int type) noexcept { /
return _Thrd_result::_Success;
}

// TRANSITION, ABI: preserved for binary compatibility
_CRTIMP2_PURE void __cdecl _Mtx_destroy(_Mtx_t mtx) noexcept { // destroy mutex
if (mtx) { // something to do, do it
_Mtx_destroy_in_situ(mtx);
Expand Down