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
1.6.0
Luigi Rizzo 20 years ago
parent 84a5921ab5
commit e58079b067

@ -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;

Loading…
Cancel
Save