mod_voicemail: that shouldve been wrlock, and its missing an unlock

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16647 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Mathieu Rene 2010-02-15 20:34:11 +00:00
parent 644664004c
commit 94b1948a57
1 changed files with 2 additions and 1 deletions

View File

@ -738,7 +738,8 @@ static void profile_rwunlock(vm_profile_t *profile)
{
switch_thread_rwlock_unlock(profile->rwlock);
if (switch_test_flag(profile, PFLAG_DESTROY)) {
if (switch_thread_rwlock_tryrdlock(profile->rwlock) == SWITCH_STATUS_SUCCESS) {
if (switch_thread_rwlock_trywrlock(profile->rwlock) == SWITCH_STATUS_SUCCESS) {
switch_thread_rwlock_unlock(profile->rwlock);
free_profile(profile);
}
}