From: Joshua Colp Date: Mon, 30 Oct 2006 18:13:07 +0000 (+0000) Subject: We need to lock the pvt structure during retransmission as another worker thread... X-Git-Tag: 1.4.0-beta4~243 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7e0a4d143b0b3d74de2256600b881e5582a3852;p=thirdparty%2Fasterisk.git We need to lock the pvt structure during retransmission as another worker thread may be doing something as well. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46474 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index e2a0feddc0..e51ccafc7c 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -8060,11 +8060,12 @@ static void *network_thread(void *ignore) continue; f->sentyet++; - /* Send a copy immediately -- errors here are ok, so don't bother locking */ + ast_mutex_lock(&iaxsl[f->callno]); if (iaxs[f->callno]) { send_packet(f); count++; } + ast_mutex_unlock(&iaxsl[f->callno]); if (f->retries < 0) { /* This is not supposed to be retransmitted */ AST_LIST_REMOVE(&iaxq.queue, f, list);