Skip to content

xlock.cpp: Should _Lock_at_thread_exit_mutex() be noexcept? #273

Closed
@StephanTLavavej

Description

@StephanTLavavej

_Lock_at_thread_exit_mutex() and _Unlock_at_thread_exit_mutex() are separately compiled, but aren't used outside the STL's DLL (or static LIB):

STL/stl/src/xlock.cpp

Lines 123 to 129 in f9b1dcc

extern "C" void _Lock_at_thread_exit_mutex() { // lock the at-thread-exit mutex
_Mtxlock(&mtx[_LOCK_AT_THREAD_EXIT]);
}
extern "C" void _Unlock_at_thread_exit_mutex() { // unlock the at-thread-exit mutex
_Mtxunlock(&mtx[_LOCK_AT_THREAD_EXIT]);
}

STL/stl/src/xnotify.cpp

Lines 31 to 34 in f9b1dcc

_EXTERN_C
void _Lock_at_thread_exit_mutex();
void _Unlock_at_thread_exit_mutex();

Since they aren't exported, I believe that it would be safe (i.e. binary-compatible) to mark them as noexcept, and give them C++ linkage.

It's also possible that there's no point in doing so; because they're extern "C" and we compile with /EHsc, they should already be treated as noexcept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions