X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fperllib.c;h=3aed2415fd35aa2f0a8761df37e34b6346c56428;hb=729a02f2394e6a50fe8352c9471391b53e54ac40;hp=26135f864e0edc2e9e1444b188cd70c2f5529b9c;hpb=1761cee512762c09b2a848d3c6cbd5a3b4232ffa;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/perllib.c b/win32/perllib.c index 26135f8..3aed241 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -160,7 +160,7 @@ perl_construct(PerlInterpreter* my_perl) CPerlHost* pHost = (CPerlHost*)w32_internal_host; Perl_free(); delete pHost; - SetPerlInterpreter(NULL); + PERL_SET_THX(NULL); } } @@ -200,7 +200,7 @@ perl_free(PerlInterpreter* my_perl) { } #endif - SetPerlInterpreter(NULL); + PERL_SET_THX(NULL); } EXTERN_C int @@ -254,26 +254,6 @@ perl_parse(PerlInterpreter* my_perl, void (*xsinit)(CPerlObj*), int argc, char** EXTERN_C HANDLE w32_perldll_handle; -static DWORD g_TlsAllocIndex; - -EXTERN_C DllExport bool -SetPerlInterpreter(void *interp) -{ - DWORD dwErr = GetLastError(); - bool bResult = TlsSetValue(g_TlsAllocIndex, interp); - SetLastError(dwErr); - return bResult; -} - -EXTERN_C DllExport void* -GetPerlInterpreter(void) -{ - DWORD dwErr = GetLastError(); - LPVOID pResult = TlsGetValue(g_TlsAllocIndex); - SetLastError(dwErr); - return pResult; -} - EXTERN_C DllExport int RunPerl(int argc, char **argv, char **env) { @@ -333,7 +313,7 @@ RunPerl(int argc, char **argv, char **env) new_perl = perl_clone(my_perl, 1); # endif exitstatus = perl_run( new_perl ); - SetPerlInterpreter(my_perl); + PERL_SET_THX(my_perl); #else exitstatus = perl_run( my_perl ); #endif @@ -343,7 +323,7 @@ RunPerl(int argc, char **argv, char **env) perl_free( my_perl ); #ifdef USE_ITHREADS if (new_perl) { - SetPerlInterpreter(new_perl); + PERL_SET_THX(new_perl); perl_destruct(new_perl); perl_free(new_perl); } @@ -371,7 +351,6 @@ DllMain(HANDLE hModule, /* DLL module handle */ setmode( fileno( stderr ), O_BINARY ); _fmode = O_BINARY; #endif - g_TlsAllocIndex = TlsAlloc(); DisableThreadLibraryCalls((HMODULE)hModule); w32_perldll_handle = hModule; break; @@ -380,7 +359,6 @@ DllMain(HANDLE hModule, /* DLL module handle */ * process termination or call to FreeLibrary. */ case DLL_PROCESS_DETACH: - TlsFree(g_TlsAllocIndex); break; /* The attached process creates a new thread. */