]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
swap rwlock and mutex
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Nov 2011 14:27:40 +0000 (08:27 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Nov 2011 14:27:46 +0000 (08:27 -0600)
src/switch_event.c

index bb7000903d9a3659be9dee17432b3055a0e3b44f..fcb913f2a5ad10d00d6d995484cf2e7b9320298e 100644 (file)
@@ -1826,8 +1826,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_bind_removable(const char *id, swit
 
        if (event <= SWITCH_EVENT_ALL) {
                switch_zmalloc(event_node, sizeof(*event_node));
-               switch_mutex_lock(BLOCK);
                switch_thread_rwlock_wrlock(RWLOCK);
+               switch_mutex_lock(BLOCK);
                /* <LOCKED> ----------------------------------------------- */
                event_node->id = DUP(id);
                event_node->event_id = event;
@@ -1842,8 +1842,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_bind_removable(const char *id, swit
                }
 
                EVENT_NODES[event] = event_node;
-               switch_thread_rwlock_unlock(RWLOCK);
                switch_mutex_unlock(BLOCK);
+               switch_thread_rwlock_unlock(RWLOCK);
                /* </LOCKED> ----------------------------------------------- */
 
                if (node) {