summaryrefslogtreecommitdiff
path: root/main/cli.c
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2006-11-16 14:41:28 +0000
committerLuigi Rizzo <rizzo@icir.org>2006-11-16 14:41:28 +0000
commite58079b06707d030990bfca3941d5887ab7bd212 (patch)
tree6d129efa4498ef14cf3487bab22415c5d79ba775 /main/cli.c
parent84a5921ab53336a83725c920409d8cb2d5209a8c (diff)
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
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c2
1 files changed, 1 insertions, 1 deletions
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;