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
This commit is contained in:
Luigi Rizzo
2006-11-16 14:41:28 +00:00
parent 84a5921ab5
commit e58079b067

View File

@@ -1640,7 +1640,7 @@ int ast_cli_command(int fd, const char *s)
AST_LIST_LOCK(&helpers); AST_LIST_LOCK(&helpers);
e = find_cli(args + 1, 0); e = find_cli(args + 1, 0);
if (e) if (e)
e->inuse++; ast_atomic_fetchadd_int(&e->inuse, 1);
AST_LIST_UNLOCK(&helpers); AST_LIST_UNLOCK(&helpers);
if (e) { if (e) {
int res; int res;