Fix negative refcount introduced by #12223.
Artur Bergman [Wed, 26 Sep 2001 07:04:21 +0000 (07:04 +0000)]
p4raw-id: //depot/perl@12225

ext/threads/threads.xs

index 5678bcb..cbfcd1f 100755 (executable)
@@ -281,12 +281,12 @@ BOOT:
 #else
                thread->thr = pthread_self();
 #endif
+               SHAREDSvEDIT(threads);
                thread_tid_ptr = Perl_newSVuv(PL_sharedsv_space, PTR2UV(thread->thr));
                thread_ptr = Perl_newSVuv(PL_sharedsv_space, PTR2UV(thread));
-               SHAREDSvEDIT(threads);
                hv_store_ent((HV*) SHAREDSvGET(threads), thread_tid_ptr, thread_ptr,0);
-               SHAREDSvRELEASE(threads);
                SvREFCNT_dec(thread_tid_ptr);
+               SHAREDSvRELEASE(threads);
        }
        MUTEX_INIT(&create_mutex);