aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-30 14:57:00 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-30 14:57:00 +0000
commit22011cf1eb67014e5cfd7f22f29762172afe2b89 (patch)
tree7bc4ff5e9b62850588337249e106c08af97073cb
parenteadc837224f44048a3955a345edfd0a0b4a2cf09 (diff)
Merged revisions 7677 via svnmerge from
/branches/1.2 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7678 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/channel.c b/channel.c
index c31773a78..4e845d64e 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);