Skip to content

Commit 1a4e1f2

Browse files
committed
remove _Mtx/Cnd_init/destroy from <xthreads.h>
1 parent a5d7849 commit 1a4e1f2

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

stl/inc/xthreads.h

-8
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ enum { // mutex types
9696
_Mtx_recursive = 0x100
9797
};
9898

99-
#ifdef _CRTBLD
100-
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t*, int);
101-
_CRTIMP2_PURE void __cdecl _Mtx_destroy(_Mtx_t);
102-
#endif // _CRTBLD
10399
_CRTIMP2_PURE void __cdecl _Mtx_init_in_situ(_Mtx_t, int);
104100
_CRTIMP2_PURE void __cdecl _Mtx_destroy_in_situ(_Mtx_t);
105101
_CRTIMP2_PURE int __cdecl _Mtx_current_owns(_Mtx_t);
@@ -117,10 +113,6 @@ void __cdecl _Smtx_unlock_exclusive(_Smtx_t*);
117113
void __cdecl _Smtx_unlock_shared(_Smtx_t*);
118114

119115
// condition variables
120-
#ifdef _CRTBLD
121-
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_init(_Cnd_t*);
122-
_CRTIMP2_PURE void __cdecl _Cnd_destroy(_Cnd_t);
123-
#endif // _CRTBLD
124116
_CRTIMP2_PURE void __cdecl _Cnd_init_in_situ(_Cnd_t);
125117
_CRTIMP2_PURE void __cdecl _Cnd_destroy_in_situ(_Cnd_t);
126118
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_wait(_Cnd_t, _Mtx_t); // TRANSITION, ABI: Always succeeds

stl/src/cond.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ _CRTIMP2_PURE void __cdecl _Cnd_init_in_situ(const _Cnd_t cond) { // initialize
2828

2929
_CRTIMP2_PURE void __cdecl _Cnd_destroy_in_situ(_Cnd_t) {} // destroy condition variable in situ
3030

31+
// TRANSITION, ABI: used only by _Thrd_create(), which is preserved for binary compatibility
3132
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_init(_Cnd_t* const pcond) { // initialize
3233
*pcond = nullptr;
3334

@@ -41,6 +42,7 @@ _CRTIMP2_PURE _Thrd_result __cdecl _Cnd_init(_Cnd_t* const pcond) { // initializ
4142
return _Thrd_result::_Success;
4243
}
4344

45+
// TRANSITION, ABI: used only by _Thrd_create(), which is preserved for binary compatibility
4446
_CRTIMP2_PURE void __cdecl _Cnd_destroy(const _Cnd_t cond) { // clean up
4547
if (cond) { // something to do, do it
4648
_Cnd_destroy_in_situ(cond);

stl/src/cthread.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ _CRTIMP2_PURE unsigned int __cdecl _Thrd_hardware_concurrency() { // return numb
109109
return info.dwNumberOfProcessors;
110110
}
111111

112+
// TRANSITION, ABI: these functions are used only by _Thrd_create()
113+
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t*, int);
114+
_CRTIMP2_PURE void __cdecl _Mtx_destroy(_Mtx_t);
115+
_CRTIMP2_PURE _Thrd_result __cdecl _Cnd_init(_Cnd_t*);
116+
_CRTIMP2_PURE void __cdecl _Cnd_destroy(_Cnd_t);
117+
112118
// TRANSITION, ABI: _Thrd_create() is preserved for binary compatibility
113119
_CRTIMP2_PURE _Thrd_result __cdecl _Thrd_create(_Thrd_t* thr, _Thrd_start_t func, void* d) { // create thread
114120
_Thrd_result res;

stl/src/mutex.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ _CRTIMP2_PURE void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx) { // destroy mutex i
5050
(void) mtx;
5151
}
5252

53+
// TRANSITION, ABI: used only by _Thrd_create(), which is preserved for binary compatibility
5354
_CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t* mtx, int type) { // initialize mutex
5455
*mtx = nullptr;
5556

@@ -65,6 +66,7 @@ _CRTIMP2_PURE _Thrd_result __cdecl _Mtx_init(_Mtx_t* mtx, int type) { // initial
6566
return _Thrd_result::_Success;
6667
}
6768

69+
// TRANSITION, ABI: used only by _Thrd_create(), which is preserved for binary compatibility
6870
_CRTIMP2_PURE void __cdecl _Mtx_destroy(_Mtx_t mtx) { // destroy mutex
6971
if (mtx) { // something to do, do it
7072
_Mtx_destroy_in_situ(mtx);

0 commit comments

Comments
 (0)