Initialize WIN_CritSection earlier.

This commit is contained in:
Ulrich Weigand 1999-05-08 09:45:50 +00:00 committed by Alexandre Julliard
parent 3d35e9894c
commit ef61c0b632
3 changed files with 15 additions and 4 deletions

View file

@ -158,6 +158,7 @@ typedef struct
#define BWA_SKIPICONIC 0x0008
/* Window functions */
extern void WIN_Init( void );
extern void WIN_LockWnds();
extern void WIN_UnlockWnds();
extern int WIN_SuspendWndsLock();

View file

@ -36,6 +36,7 @@
#include "global.h"
#include "dce.h"
#include "shell.h"
#include "win.h"
#include "winproc.h"
#include "syslevel.h"
#include "services.h"
@ -213,6 +214,9 @@ BOOL WINAPI MAIN_UserInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserve
/* Global atom table initialisation */
if (!ATOM_Init( USER_HeapSel )) return FALSE;
/* Initialize window handling (critical section) */
WIN_Init();
/* Initialize system colors and metrics*/
SYSMETRICS_Init();
SYSCOLOR_Init();

View file

@ -52,6 +52,16 @@ static WORD wDragHeight= 3;
/* thread safeness */
static CRITICAL_SECTION WIN_CritSection;
/***********************************************************************
* WIN_Init
*/
void WIN_Init( void )
{
/* Initialisation of the critical section for thread safeness */
InitializeCriticalSection(&WIN_CritSection);
MakeCriticalSectionGlobal(&WIN_CritSection);
}
/***********************************************************************
* WIN_LockWnds
*
@ -604,10 +614,6 @@ BOOL WIN_CreateDesktopWindow(void)
TRACE_(win)("Creating desktop window\n");
/* Initialisation of the critical section for thread safeness */
InitializeCriticalSection(&WIN_CritSection);
MakeCriticalSectionGlobal(&WIN_CritSection);
if (!ICONTITLE_Init() ||
!WINPOS_CreateInternalPosAtom() ||