]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
avoid deadlock
authorMichael Jerris <mike@jerris.com>
Sun, 30 Dec 2007 23:25:45 +0000 (23:25 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 30 Dec 2007 23:25:45 +0000 (23:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7033 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_presence.c

index 69e2f2eb0892c44f4d94136680e60303367b2b7a..9bde6d33f02e1f7a3757a8a53cf0f07b70f182d8 100644 (file)
@@ -1081,13 +1081,14 @@ void sofia_presence_handle_sip_i_subscribe(int status,
                        sofia_glue_execute_sql(profile, SWITCH_FALSE, sql, NULL);
                        free(sql);
 
-                       switch_mutex_unlock(profile->ireg_mutex);
                        sstr = switch_mprintf("active;expires=%ld", exp_raw);
                        if (status < 200) {
                                switch_core_hash_insert(profile->sub_hash, call_id, nh);
                        }
                }
        
+               switch_mutex_unlock(profile->ireg_mutex);
+
                if (status < 200) {
                        nua_respond(nh, SIP_202_ACCEPTED,
                                                NUTAG_WITH_THIS(nua),