X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=blobdiff_plain;f=Magic.xs;h=947ae72a0246b945f2759deaaa5cbff9afe43382;hp=207fcb383a75a3162632239b0cc74c7ff5335504;hb=8c151d16f3a7a40201fab13e4fb92433eb6f9c7c;hpb=64d80b88646a16ec430354d4139798d152f0e3ca diff --git a/Magic.xs b/Magic.xs index 207fcb3..947ae72 100644 --- a/Magic.xs +++ b/Magic.xs @@ -1881,12 +1881,14 @@ static void vmg_setup(pTHX) { #if VMG_THREADSAFE VMG_LOADED_LOCK; - if (vmg_loaded <= 0) { - assert(vmg_loaded == 0); + if (vmg_loaded == 0) { MUTEX_INIT(&vmg_vtable_refcount_mutex); MUTEX_INIT(&vmg_op_name_init_mutex); + vmg_loaded = 1; + } else { + assert(vmg_loaded > 0); + ++vmg_loaded; } - ++vmg_loaded; VMG_LOADED_UNLOCK; #endif