From bec3244f399597331eed986962295d41a6f4a537 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 10 Jul 2000 15:23:04 +0000 Subject: [PATCH] Lazy initialisation of thread locale. --- scheduler/thread.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scheduler/thread.c b/scheduler/thread.c index 0ee4d62cdf8..7d200bdd40e 100644 --- a/scheduler/thread.c +++ b/scheduler/thread.c @@ -90,7 +90,6 @@ static BOOL THREAD_InitTEB( TEB *teb ) teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer); teb->StaticUnicodeString.Buffer = (PWSTR)teb->StaticUnicodeBuffer; teb->teb_sel = SELECTOR_AllocBlock( teb, 0x1000, SEGMENT_DATA, TRUE, FALSE ); - teb->CurrentLocale = GetUserDefaultLCID(); /* for threads in user context */ return (teb->teb_sel != 0); } @@ -272,10 +271,6 @@ static void THREAD_Start(void) /*********************************************************************** * CreateThread (KERNEL32.63) - * - * NOTE - * this function is not called for the first thread of a process - * do initializations in THREAD_InitTEB */ HANDLE WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack, LPTHREAD_START_ROUTINE start, LPVOID param, @@ -858,7 +853,9 @@ VOID WINAPI VWin32_BoostThreadStatic( DWORD threadId, INT boost ) */ LCID WINAPI GetThreadLocale(void) { - return NtCurrentTeb()->CurrentLocale; + LCID ret = NtCurrentTeb()->CurrentLocale; + if (!ret) NtCurrentTeb()->CurrentLocale = ret = GetUserDefaultLCID(); + return ret; }