From: Artur Bergman Date: Thu, 12 Jun 2003 08:37:39 +0000 (+0000) Subject: Be polite and destroy the mutexes and conditions we use! X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=579f9913bd0b54ec2474ba1d4322c32a64a3ee05;p=p5sagit%2Fp5-mst-13.2.git Be polite and destroy the mutexes and conditions we use! p4raw-id: //depot/perl@19746 --- diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs index 8fe678d..67048dd 100644 --- a/ext/threads/shared/shared.xs +++ b/ext/threads/shared/shared.xs @@ -61,6 +61,12 @@ recursive_lock_init(pTHX_ recursive_lock_t *lock) COND_INIT(&lock->cond); } +recursive_lock_destroy(pTHX_ recursive_lock_t *lock) +{ + MUTEX_DESTROY(&lock->mutex); + COND_DESTROY(&lock->cond); +} + void recursive_lock_release(pTHX_ recursive_lock_t *lock) { @@ -157,6 +163,8 @@ sharedsv_shared_mg_free(pTHX_ SV *sv, MAGIC *mg) shared_sv *shared = (shared_sv *) mg->mg_ptr; assert( aTHX == PL_sharedsv_space ); if (shared) { + recursive_lock_init(aTHX_ &shared->lock); + COND_DESTROY(&shared->user_cond); PerlMemShared_free(shared); mg->mg_ptr = NULL; }