From: Tilghman Lesher Date: Fri, 30 Dec 2005 14:57:00 +0000 (+0000) Subject: Merged revisions 7677 via svnmerge from X-Git-Tag: 1.4.0-beta1~3112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75dc984c3137a40d7c2aa2d4246651c2fbc1917f;p=thirdparty%2Fasterisk.git Merged revisions 7677 via svnmerge from /branches/1.2 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7678 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channel.c b/channel.c index c31773a78e..4e845d64e3 100644 --- a/channel.c +++ b/channel.c @@ -94,6 +94,7 @@ struct ast_channel_spy_list { */ static int shutting_down = 0; +AST_MUTEX_DEFINE_STATIC(uniquelock); static int uniqueint = 0; unsigned long global_fin = 0, global_fout = 0; @@ -572,7 +573,9 @@ struct ast_channel *ast_channel_alloc(int needqueue) tmp->data = NULL; tmp->fin = global_fin; tmp->fout = global_fout; + ast_mutex_lock(&uniquelock); snprintf(tmp->uniqueid, sizeof(tmp->uniqueid), "%li.%d", (long) time(NULL), uniqueint++); + ast_mutex_unlock(&uniquelock); headp = &tmp->varshead; ast_mutex_init(&tmp->lock); AST_LIST_HEAD_INIT_NOLOCK(headp);