Fix negative refcount introduced by #12223.
authorArtur Bergman <sky@nanisky.com>
Wed, 26 Sep 2001 07:04:21 +0000 (07:04 +0000)
committerArtur Bergman <sky@nanisky.com>
Wed, 26 Sep 2001 07:04:21 +0000 (07:04 +0000)
p4raw-id: //depot/perl@12225

ext/threads/threads.xs

index 5678bcb71a5413e577ec9efb807353d2547fb7c5..cbfcd1f0f891741eccbff5839e54d9cae5b24717 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);