]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
How about manipulating the right lock
authorMark Spencer <markster@digium.com>
Tue, 26 Aug 2003 04:08:12 +0000 (04:08 +0000)
committerMark Spencer <markster@digium.com>
Tue, 26 Aug 2003 04:08:12 +0000 (04:08 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1438 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index ee33b145bacda510653c98c969d114b310db9165..ef9fac05be6aad043a6ca6ed0d6d6dbc84b87e67 100755 (executable)
@@ -835,7 +835,7 @@ static int check_beep(struct agent_pvt *newlyavailable, int needlock)
        if (needlock)
                ast_mutex_unlock(&agentlock);
        if (p) {
-               ast_mutex_unlock(&p->lock);
+               ast_mutex_unlock(&newlyavailable->lock);
                ast_log( LOG_DEBUG, "Playing beep, lang '%s'\n", newlyavailable->chan->language);
                res = ast_streamfile(newlyavailable->chan, "beep", newlyavailable->chan->language);
                ast_log( LOG_DEBUG, "Played beep, result '%d'\n", res);
@@ -843,7 +843,7 @@ static int check_beep(struct agent_pvt *newlyavailable, int needlock)
                        res = ast_waitstream(newlyavailable->chan, "");
                        ast_log( LOG_DEBUG, "Waited for stream, result '%d'\n", res);
                }
-               ast_mutex_lock(&p->lock);
+               ast_mutex_lock(&newlyavailable->lock);
        }
        return res;
 }