Integrated latest changes from mainline into win32.
Gurusamy Sarathy [Wed, 15 Oct 1997 18:02:46 +0000 (18:02 +0000)]
p4raw-id: //depot/win32/perl@133

1  2 
perl.c
thread.h

diff --cc perl.c
--- 1/perl.c
--- 2/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");
diff --cc thread.h
Simple merge