msvcp90: Added _Lockit class implementation.
This commit is contained in:
parent
00f7683ea7
commit
b8606c82ee
|
@ -90,3 +90,85 @@ void CDECL mutex_mutex_dtor(mutex *m)
|
||||||
{
|
{
|
||||||
mutex_dtor(m);
|
mutex_dtor(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define _LOCK_LOCALE 0
|
||||||
|
#define _LOCK_MALLOC 1
|
||||||
|
#define _LOCK_STREAM 2
|
||||||
|
#define _LOCK_DEBUG 3
|
||||||
|
#define _MAX_LOCK 4
|
||||||
|
static CRITICAL_SECTION lockit_cs[_MAX_LOCK];
|
||||||
|
|
||||||
|
/* ?_Lockit_ctor@_Lockit@std@@SAXH@Z */
|
||||||
|
void __cdecl _Lockit_init(int locktype) {
|
||||||
|
InitializeCriticalSection(&lockit_cs[locktype]);
|
||||||
|
lockit_cs[locktype].DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": _Lockit critical section");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ?_Lockit_dtor@_Lockit@std@@SAXH@Z */
|
||||||
|
void __cdecl _Lockit_free(int locktype)
|
||||||
|
{
|
||||||
|
lockit_cs[locktype].DebugInfo->Spare[0] = (DWORD_PTR)0;
|
||||||
|
DeleteCriticalSection(&lockit_cs[locktype]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void init_lockit(void) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for(i=0; i<_MAX_LOCK; i++)
|
||||||
|
_Lockit_init(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void free_lockit(void) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for(i=0; i<_MAX_LOCK; i++)
|
||||||
|
_Lockit_free(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ?_Lockit_ctor@_Lockit@std@@CAXPAV12@H@Z */
|
||||||
|
/* ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@H@Z */
|
||||||
|
void __cdecl _Lockit__Lockit_ctor_locktype(_Lockit *lockit, int locktype)
|
||||||
|
{
|
||||||
|
lockit->locktype = locktype;
|
||||||
|
EnterCriticalSection(&lockit_cs[locktype]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ?_Lockit_ctor@_Lockit@std@@CAXPAV12@@Z */
|
||||||
|
/* ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@@Z */
|
||||||
|
void __cdecl _Lockit__Lockit_ctor(_Lockit *lockit)
|
||||||
|
{
|
||||||
|
_Lockit__Lockit_ctor_locktype(lockit, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ??0_Lockit@std@@QAE@H@Z */
|
||||||
|
/* ??0_Lockit@std@@QEAA@H@Z */
|
||||||
|
DEFINE_THISCALL_WRAPPER(_Lockit_ctor_locktype, 8)
|
||||||
|
_Lockit* __thiscall _Lockit_ctor_locktype(_Lockit *this, int locktype)
|
||||||
|
{
|
||||||
|
_Lockit__Lockit_ctor_locktype(this, locktype);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ??0_Lockit@std@@QAE@XZ */
|
||||||
|
/* ??0_Lockit@std@@QEAA@XZ */
|
||||||
|
DEFINE_THISCALL_WRAPPER(_Lockit_ctor, 4)
|
||||||
|
_Lockit* __thiscall _Lockit_ctor(_Lockit *this)
|
||||||
|
{
|
||||||
|
_Lockit__Lockit_ctor_locktype(this, 0);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ?_Lockit_dtor@_Lockit@std@@CAXPAV12@@Z */
|
||||||
|
/* ?_Lockit_dtor@_Lockit@std@@CAXPEAV12@@Z */
|
||||||
|
void __cdecl _Lockit__Lockit_dtor(_Lockit *lockit)
|
||||||
|
{
|
||||||
|
LeaveCriticalSection(&lockit_cs[lockit->locktype]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ??1_Lockit@std@@QAE@XZ */
|
||||||
|
/* ??1_Lockit@std@@QEAA@XZ */
|
||||||
|
DEFINE_THISCALL_WRAPPER(_Lockit_dtor, 4)
|
||||||
|
void __thiscall _Lockit_dtor(_Lockit *this)
|
||||||
|
{
|
||||||
|
_Lockit__Lockit_dtor(this);
|
||||||
|
}
|
||||||
|
|
|
@ -193,3 +193,11 @@ typedef struct
|
||||||
{
|
{
|
||||||
struct locale__Locimp *ptr;
|
struct locale__Locimp *ptr;
|
||||||
} locale;
|
} locale;
|
||||||
|
|
||||||
|
/* class _Lockit */
|
||||||
|
typedef struct {
|
||||||
|
int locktype;
|
||||||
|
} _Lockit;
|
||||||
|
|
||||||
|
void init_lockit(void);
|
||||||
|
void free_lockit(void);
|
||||||
|
|
|
@ -1078,10 +1078,10 @@
|
||||||
@ stub -arch=win64 ??0_Locinfo@std@@QEAA@HPEBD@Z
|
@ stub -arch=win64 ??0_Locinfo@std@@QEAA@HPEBD@Z
|
||||||
@ stub -arch=win32 ??0_Locinfo@std@@QAE@PBD@Z
|
@ stub -arch=win32 ??0_Locinfo@std@@QAE@PBD@Z
|
||||||
@ stub -arch=win64 ??0_Locinfo@std@@QEAA@PEBD@Z
|
@ stub -arch=win64 ??0_Locinfo@std@@QEAA@PEBD@Z
|
||||||
@ stub -arch=win32 ??0_Lockit@std@@QAE@H@Z
|
@ thiscall -arch=win32 ??0_Lockit@std@@QAE@H@Z(ptr long) _Lockit_ctor_locktype
|
||||||
@ stub -arch=win64 ??0_Lockit@std@@QEAA@H@Z
|
@ cdecl -arch=win64 ??0_Lockit@std@@QEAA@H@Z(ptr long) _Lockit_ctor_locktype
|
||||||
@ stub -arch=win32 ??0_Lockit@std@@QAE@XZ
|
@ thiscall -arch=win32 ??0_Lockit@std@@QAE@XZ(ptr) _Lockit_ctor
|
||||||
@ stub -arch=win64 ??0_Lockit@std@@QEAA@XZ
|
@ cdecl -arch=win64 ??0_Lockit@std@@QEAA@XZ(ptr) _Lockit_ctor
|
||||||
@ thiscall -arch=win32 ??0_Mutex@std@@QAE@XZ(ptr) mutex_ctor
|
@ thiscall -arch=win32 ??0_Mutex@std@@QAE@XZ(ptr) mutex_ctor
|
||||||
@ cdecl -arch=win64 ??0_Mutex@std@@QEAA@XZ(ptr) mutex_ctor
|
@ cdecl -arch=win64 ??0_Mutex@std@@QEAA@XZ(ptr) mutex_ctor
|
||||||
@ stub -arch=win32 ??0_Timevec@std@@QAE@ABV01@@Z
|
@ stub -arch=win32 ??0_Timevec@std@@QAE@ABV01@@Z
|
||||||
|
@ -1316,8 +1316,8 @@
|
||||||
@ cdecl -arch=win64 ??1_Locimp@locale@std@@MEAA@XZ(ptr) locale__Locimp_dtor
|
@ cdecl -arch=win64 ??1_Locimp@locale@std@@MEAA@XZ(ptr) locale__Locimp_dtor
|
||||||
@ stub -arch=win32 ??1_Locinfo@std@@QAE@XZ
|
@ stub -arch=win32 ??1_Locinfo@std@@QAE@XZ
|
||||||
@ stub -arch=win64 ??1_Locinfo@std@@QEAA@XZ
|
@ stub -arch=win64 ??1_Locinfo@std@@QEAA@XZ
|
||||||
@ stub -arch=win32 ??1_Lockit@std@@QAE@XZ
|
@ thiscall -arch=win32 ??1_Lockit@std@@QAE@XZ(ptr) _Lockit_dtor
|
||||||
@ stub -arch=win64 ??1_Lockit@std@@QEAA@XZ
|
@ cdecl -arch=win64 ??1_Lockit@std@@QEAA@XZ(ptr) _Lockit_dtor
|
||||||
@ thiscall -arch=win32 ??1_Mutex@std@@QAE@XZ(ptr) mutex_dtor
|
@ thiscall -arch=win32 ??1_Mutex@std@@QAE@XZ(ptr) mutex_dtor
|
||||||
@ cdecl -arch=win64 ??1_Mutex@std@@QEAA@XZ(ptr) mutex_dtor
|
@ cdecl -arch=win64 ??1_Mutex@std@@QEAA@XZ(ptr) mutex_dtor
|
||||||
@ stub -arch=win32 ??1_Timevec@std@@QAE@XZ
|
@ stub -arch=win32 ??1_Timevec@std@@QAE@XZ
|
||||||
|
@ -2599,14 +2599,14 @@
|
||||||
@ stub -arch=win64 ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ
|
@ stub -arch=win64 ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ
|
||||||
@ thiscall -arch=win32 ?_Lock@_Mutex@std@@QAEXXZ(ptr) mutex_lock
|
@ thiscall -arch=win32 ?_Lock@_Mutex@std@@QAEXXZ(ptr) mutex_lock
|
||||||
@ cdecl -arch=win64 ?_Lock@_Mutex@std@@QEAAXXZ(ptr) mutex_lock
|
@ cdecl -arch=win64 ?_Lock@_Mutex@std@@QEAAXXZ(ptr) mutex_lock
|
||||||
@ stub -arch=win32 ?_Lockit_ctor@_Lockit@std@@CAXPAV12@@Z
|
@ cdecl -arch=win32 ?_Lockit_ctor@_Lockit@std@@CAXPAV12@@Z(ptr) _Lockit__Lockit_ctor
|
||||||
@ stub -arch=win64 ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@@Z
|
@ cdecl -arch=win64 ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@@Z(ptr) _Lockit__Lockit_ctor
|
||||||
@ stub -arch=win32 ?_Lockit_ctor@_Lockit@std@@CAXPAV12@H@Z
|
@ cdecl -arch=win32 ?_Lockit_ctor@_Lockit@std@@CAXPAV12@H@Z(ptr long) _Lockit__Lockit_ctor_locktype
|
||||||
@ stub -arch=win64 ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@H@Z
|
@ cdecl -arch=win64 ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@H@Z(ptr long) _Lockit__Lockit_ctor_locktype
|
||||||
@ stub ?_Lockit_ctor@_Lockit@std@@SAXH@Z
|
@ cdecl ?_Lockit_ctor@_Lockit@std@@SAXH@Z(long) _Lockit_init
|
||||||
@ stub -arch=win32 ?_Lockit_dtor@_Lockit@std@@CAXPAV12@@Z
|
@ cdecl -arch=win32 ?_Lockit_dtor@_Lockit@std@@CAXPAV12@@Z(ptr) _Lockit__Lockit_dtor
|
||||||
@ stub -arch=win64 ?_Lockit_dtor@_Lockit@std@@CAXPEAV12@@Z
|
@ cdecl -arch=win64 ?_Lockit_dtor@_Lockit@std@@CAXPEAV12@@Z(ptr) _Lockit__Lockit_dtor
|
||||||
@ stub ?_Lockit_dtor@_Lockit@std@@SAXH@Z
|
@ cdecl ?_Lockit_dtor@_Lockit@std@@SAXH@Z(long) _Lockit_free
|
||||||
@ stub -arch=win32 ?_MP_Add@tr1@std@@YAXQA_K_K@Z
|
@ stub -arch=win32 ?_MP_Add@tr1@std@@YAXQA_K_K@Z
|
||||||
@ stub -arch=win64 ?_MP_Add@tr1@std@@YAXQEA_K_K@Z
|
@ stub -arch=win64 ?_MP_Add@tr1@std@@YAXQEA_K_K@Z
|
||||||
@ stub -arch=win32 ?_MP_Get@tr1@std@@YA_KQA_K@Z
|
@ stub -arch=win32 ?_MP_Get@tr1@std@@YA_KQA_K@Z
|
||||||
|
|
|
@ -57,8 +57,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
init_cxx_funcs();
|
init_cxx_funcs();
|
||||||
set_exception_vtable();
|
set_exception_vtable();
|
||||||
|
init_lockit();
|
||||||
break;
|
break;
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
|
free_lockit();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue