Commit 6482ce76 authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Enable multi-thread locking by default.

parent 66618e62
EXTRADEFS = -D_MT -D_MSVCR_VER=0 -D_CRTDLL
EXTRADEFS = -D_MSVCR_VER=0 -D_CRTDLL
MODULE = crtdll.dll
PARENTSRC = ../msvcrt
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=100
EXTRADEFS = -D_MSVCR_VER=100
MODULE = msvcr100.dll
IMPORTLIB = msvcr100
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=110
EXTRADEFS = -D_MSVCR_VER=110
MODULE = msvcr110.dll
IMPORTLIB = msvcr110
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=120
EXTRADEFS = -D_MSVCR_VER=120
MODULE = msvcr120.dll
IMPORTLIB = msvcr120
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=70
EXTRADEFS = -D_MSVCR_VER=70
MODULE = msvcr70.dll
IMPORTLIB = msvcr70
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=71
EXTRADEFS = -D_MSVCR_VER=71
MODULE = msvcr71.dll
IMPORTLIB = msvcr71
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=80
EXTRADEFS = -D_MSVCR_VER=80
MODULE = msvcr80.dll
IMPORTLIB = msvcr80
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=90
EXTRADEFS = -D_MSVCR_VER=90
MODULE = msvcr90.dll
IMPORTLIB = msvcr90
DELAYIMPORTS = advapi32 user32
......
EXTRADEFS = -D_MT -D_MSVCR_VER=0
EXTRADEFS = -D_MSVCR_VER=0
MODULE = msvcrt.dll
IMPORTLIB = msvcrt
DELAYIMPORTS = advapi32 user32
......
......@@ -32,8 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
/* MT */
#define LOCK_CONSOLE _mlock(_CONIO_LOCK)
#define UNLOCK_CONSOLE _munlock(_CONIO_LOCK)
#define LOCK_CONSOLE _lock(_CONIO_LOCK)
#define UNLOCK_CONSOLE _unlock(_CONIO_LOCK)
static HANDLE MSVCRT_console_in = INVALID_HANDLE_VALUE;
static HANDLE MSVCRT_console_out= INVALID_HANDLE_VALUE;
......
......@@ -26,8 +26,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
/* MT */
#define LOCK_EXIT _mlock(_EXIT_LOCK1)
#define UNLOCK_EXIT _munlock(_EXIT_LOCK1)
#define LOCK_EXIT _lock(_EXIT_LOCK1)
#define UNLOCK_EXIT _unlock(_EXIT_LOCK1)
static MSVCRT_purecall_handler purecall_handler = NULL;
......
......@@ -29,8 +29,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
/* MT */
#define LOCK_HEAP _mlock( _HEAP_LOCK )
#define UNLOCK_HEAP _munlock( _HEAP_LOCK )
#define LOCK_HEAP _lock( _HEAP_LOCK )
#define UNLOCK_HEAP _unlock( _HEAP_LOCK )
/* _aligned */
#define SAVED_PTR(x) ((void *)((DWORD_PTR)((char *)x - sizeof(void *)) & \
......
......@@ -1122,7 +1122,7 @@ void free_mbcinfo(MSVCRT_pthreadmbcinfo mbcinfo)
*/
void CDECL _lock_locales(void)
{
_mlock(_SETLOCALE_LOCK);
_lock(_SETLOCALE_LOCK);
}
/*********************************************************************
......@@ -1130,7 +1130,7 @@ void CDECL _lock_locales(void)
*/
void CDECL _unlock_locales(void)
{
_munlock(_SETLOCALE_LOCK);
_unlock(_SETLOCALE_LOCK);
}
MSVCRT__locale_t CDECL get_current_locale_noalloc(MSVCRT__locale_t locale)
......
......@@ -19,22 +19,9 @@
#ifndef WINE_MTDLL_H
#define WINE_MTDLL_H
#if defined(_MT)
#define _mlock(locknum) _lock(locknum)
#define _munlock(locknum) _unlock(locknum)
void __cdecl _unlock( int locknum );
void __cdecl _lock( int locknum );
#else
#define _mlock(locknum) do {} while(0)
#define _munlock(locknum) do {} while(0)
#endif
#define _SIGNAL_LOCK 1
#define _IOB_SCAN_LOCK 2
#define _TMPNAM_LOCK 3
......
......@@ -51,13 +51,13 @@ int __cdecl _register_onexit_function(_onexit_table_t *table, _onexit_t func)
if (!table)
return -1;
_mlock(_EXIT_LOCK1);
_lock(_EXIT_LOCK1);
if (!table->_first)
{
table->_first = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32 * sizeof(void *));
if (!table->_first)
{
_munlock(_EXIT_LOCK1);
_unlock(_EXIT_LOCK1);
return -1;
}
table->_last = table->_first;
......@@ -71,7 +71,7 @@ int __cdecl _register_onexit_function(_onexit_table_t *table, _onexit_t func)
_PVFV *tmp = HeapReAlloc(GetProcessHeap(), 0, table->_first, 2 * len * sizeof(void *));
if (!tmp)
{
_munlock(_EXIT_LOCK1);
_unlock(_EXIT_LOCK1);
return -1;
}
table->_first = tmp;
......@@ -81,7 +81,7 @@ int __cdecl _register_onexit_function(_onexit_table_t *table, _onexit_t func)
*table->_last = (_PVFV)func;
table->_last++;
_munlock(_EXIT_LOCK1);
_unlock(_EXIT_LOCK1);
return 0;
}
......@@ -97,10 +97,10 @@ int __cdecl _execute_onexit_table(_onexit_table_t *table)
if (!table)
return -1;
_mlock(_EXIT_LOCK1);
_lock(_EXIT_LOCK1);
if (!table->_first || table->_first >= table->_last)
{
_munlock(_EXIT_LOCK1);
_unlock(_EXIT_LOCK1);
return 0;
}
copy._first = table->_first;
......@@ -108,7 +108,7 @@ int __cdecl _execute_onexit_table(_onexit_table_t *table)
copy._end = table->_end;
memset(table, 0, sizeof(*table));
_initialize_onexit_table(table);
_munlock(_EXIT_LOCK1);
_unlock(_EXIT_LOCK1);
for (func = copy._last - 1; func >= copy._first; func--)
{
......
......@@ -1083,7 +1083,7 @@ MSVCRT_FILE* CDECL MSVCRT__wpopen(const MSVCRT_wchar_t* command, const MSVCRT_wc
fdToDup = readPipe ? 1 : 0;
fdToOpen = readPipe ? 0 : 1;
_mlock(_POPEN_LOCK);
_lock(_POPEN_LOCK);
for(i=0; i<popen_handles_size; i++)
{
if (!popen_handles[i].f)
......@@ -1135,7 +1135,7 @@ MSVCRT_FILE* CDECL MSVCRT__wpopen(const MSVCRT_wchar_t* command, const MSVCRT_wc
MSVCRT__close(fds[fdToOpen]);
container->f = ret;
}
_munlock(_POPEN_LOCK);
_unlock(_POPEN_LOCK);
HeapFree(GetProcessHeap(), 0, comspec);
HeapFree(GetProcessHeap(), 0, fullcmd);
MSVCRT__dup2(fdStdHandle, fdToDup);
......@@ -1143,7 +1143,7 @@ MSVCRT_FILE* CDECL MSVCRT__wpopen(const MSVCRT_wchar_t* command, const MSVCRT_wc
return ret;
error:
_munlock(_POPEN_LOCK);
_unlock(_POPEN_LOCK);
if (fdStdHandle != -1) MSVCRT__close(fdStdHandle);
MSVCRT__close(fds[0]);
MSVCRT__close(fds[1]);
......@@ -1187,7 +1187,7 @@ int CDECL MSVCRT__pclose(MSVCRT_FILE* file)
if (!MSVCRT_CHECK_PMT(file != NULL)) return -1;
_mlock(_POPEN_LOCK);
_lock(_POPEN_LOCK);
for(i=0; i<popen_handles_size; i++)
{
if (popen_handles[i].f == file)
......@@ -1195,14 +1195,14 @@ int CDECL MSVCRT__pclose(MSVCRT_FILE* file)
}
if(i == popen_handles_size)
{
_munlock(_POPEN_LOCK);
_unlock(_POPEN_LOCK);
*MSVCRT__errno() = MSVCRT_EBADF;
return -1;
}
h = popen_handles[i].proc;
popen_handles[i].f = NULL;
_munlock(_POPEN_LOCK);
_unlock(_POPEN_LOCK);
MSVCRT_fclose(file);
if(WaitForSingleObject(h, INFINITE)==WAIT_FAILED || !GetExitCodeProcess(h, &i))
......
......@@ -111,7 +111,7 @@ void CDECL MSVCRT__tzset(void)
char *tz = MSVCRT_getenv("TZ");
BOOL error;
_mlock(_TIME_LOCK);
_lock(_TIME_LOCK);
if(tz && tz[0]) {
BOOL neg_zone = FALSE;
......@@ -158,7 +158,7 @@ void CDECL MSVCRT__tzset(void)
sizeof(tzname_dst), NULL, &error) || error)
*MSVCRT__tzname[0] = 0;
}
_munlock(_TIME_LOCK);
_unlock(_TIME_LOCK);
}
static void _tzset_init(void)
......@@ -166,12 +166,12 @@ static void _tzset_init(void)
static BOOL init = FALSE;
if(!init) {
_mlock(_TIME_LOCK);
_lock(_TIME_LOCK);
if(!init) {
MSVCRT__tzset();
init = TRUE;
}
_munlock(_TIME_LOCK);
_unlock(_TIME_LOCK);
}
}
......
EXTRADEFS = -D_MT -D_MSVCR_VER=0
EXTRADEFS = -D_MSVCR_VER=0
MODULE = msvcrtd.dll
IMPORTLIB = msvcrtd
PARENTSRC = ../msvcrt
......
EXTRADEFS = -D_MT -D_MSVCR_VER=140
EXTRADEFS = -D_MSVCR_VER=140
MODULE = ucrtbase.dll
IMPORTLIB = ucrtbase
DELAYIMPORTS = advapi32 user32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment