Browse Source

fix more locking problems

git.mgm/mediaproxy-ng/2.1
Richard Fuchs 13 years ago
parent
commit
bb054ec00b
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      daemon/call.c

+ 3
- 1
daemon/call.c View File

@ -1206,6 +1206,7 @@ found:
DBG("creating new callstream"); DBG("creating new callstream");
cs = callstream_new(c, t->num); cs = callstream_new(c, t->num);
mutex_lock(&cs->lock);
if (!r) { if (!r) {
/* nothing found to re-use, open new ports */ /* nothing found to re-use, open new ports */
@ -1229,6 +1230,7 @@ found:
mutex_unlock(&cs_o->lock); mutex_unlock(&cs_o->lock);
} }
mutex_unlock(&cs->lock);
g_queue_push_tail(q, cs); /* hand over the ref of new cs */ g_queue_push_tail(q, cs); /* hand over the ref of new cs */
ZERO(c->lookup_done); ZERO(c->lookup_done);
continue; continue;
@ -1297,8 +1299,8 @@ got_cs:
mutex_unlock(&cs_o->lock); mutex_unlock(&cs_o->lock);
cs_o = cs; cs_o = cs;
cs = callstream_new(c, t->num); cs = callstream_new(c, t->num);
callstream_init(cs, 0, 0);
mutex_lock(&cs->lock); mutex_lock(&cs->lock);
callstream_init(cs, 0, 0);
steal_peer(&cs->peers[0], &cs_o->peers[0]); steal_peer(&cs->peers[0], &cs_o->peers[0]);
p = &cs->peers[1]; p = &cs->peers[1];
setup_peer(p, t, tag); setup_peer(p, t, tag);


Loading…
Cancel
Save