mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 16:20:37 +00:00
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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user