From e58079b06707d030990bfca3941d5887ab7bd212 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Thu, 16 Nov 2006 14:41:28 +0000 Subject: use atomic instructions to update the inuse counters for CLI entriesC. The lock is not protecting this field. I wonder if the field should be declared 'volatile' as well. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47731 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/cli.c') diff --git a/main/cli.c b/main/cli.c index 2dc6afa1f..c5fe8b331 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1640,7 +1640,7 @@ int ast_cli_command(int fd, const char *s) AST_LIST_LOCK(&helpers); e = find_cli(args + 1, 0); if (e) - e->inuse++; + ast_atomic_fetchadd_int(&e->inuse, 1); AST_LIST_UNLOCK(&helpers); if (e) { int res; -- cgit v1.2.3