From: Gurusamy Sarathy Date: Wed, 15 Oct 1997 18:02:46 +0000 (+0000) Subject: Integrated latest changes from mainline into win32. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1c753a65f1cb6413872244e48f070d07d2e1ff5;p=p5sagit%2Fp5-mst-13.2.git Integrated latest changes from mainline into win32. p4raw-id: //depot/win32/perl@133 --- e1c753a65f1cb6413872244e48f070d07d2e1ff5 diff --cc perl.c index e654675,9f49b83..901fda2 --- a/perl.c +++ b/perl.c @@@ -132,32 -132,14 +132,30 @@@ register PerlInterpreter *sv_interp nthreads = 1; cvcache = newHV(); curcop = &compiling; - thr->flags = THRf_NORMAL; + thr->flags = THRf_R_JOINABLE; + MUTEX_INIT(&thr->mutex); thr->next = thr; thr->prev = thr; - #ifdef FAKE_THREADS - self = thr; - thr->next_run = thr->prev_run = thr; - thr->wait_queue = 0; - thr->private = 0; thr->tid = 0; + #ifdef HAVE_THREAD_INTERN + init_thread_intern(thr); #else +#ifdef WIN32 + DuplicateHandle(GetCurrentProcess(), + GetCurrentThread(), + GetCurrentProcess(), + &self, + 0, + FALSE, + DUPLICATE_SAME_ACCESS); + /* XXX TlsAlloc() should probably be done in the DLL entry + * point also. + */ + if ((thr_key = TlsAlloc()) == TLS_OUT_OF_INDEXES) + croak("panic: pthread_key_create"); + if (TlsSetValue(thr_key, (LPVOID) thr) != TRUE) + croak("panic: pthread_setspecific"); +#else self = pthread_self(); if (pthread_key_create(&thr_key, 0)) croak("panic: pthread_key_create");