]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Merged revisions 292867 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Mon, 25 Oct 2010 19:07:50 +0000 (19:07 +0000)
committerDavid Vossel <dvossel@digium.com>
Mon, 25 Oct 2010 19:07:50 +0000 (19:07 +0000)
commit3020818583d84d2130c4e5e48c408db93b4d58b5
tree212f4150c3d86e21d6ffdc05b9b0728165b2c437
parent739dcea39b0b707c9b1b3f9a161cfa19ecb1449f
Merged revisions 292867 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r292867 | dvossel | 2010-10-25 14:06:21 -0500 (Mon, 25 Oct 2010) | 32 lines

  Merged revisions 292866 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r292866 | dvossel | 2010-10-25 14:05:07 -0500 (Mon, 25 Oct 2010) | 27 lines

    This patch turns chan_local pvts into astobj2 objects.

    chan_local does some dangerous things involving deadlock avoidance.
    tech_pvt functions like hangup and queue_frame are provided with a
    locked channel upon entry.  Those functions are completely safe as
    long as you don't attempt to give up that channel lock, but that is
    impossible to guarantee due to the required deadlock avoidance necessary
    to lock both the tech_pvt and both channels involved.

    In the past, we have tried to account for this by doing things like
    setting a "glare" flag that indicates what function should destroy the
    pvt.  This was used in local_hangup and local_queue_frame to decided
    who should destroy the pvt if they collided in separate threads.  I
    have removed the need to do this by converting all chan_local tech_pvts
    to astobj2.  This means we can ref a pvt before deadlock avoidance
    and not have to worry about that pvt possibly getting destroyed under
    us.  It also cleans up where we destroy the tech_pvt.  The only unlink
    from the tech_pvt container occurs in local_hangup now, which is where
    it should occur.

    Since there still may be thread collisions on some functions like
    local_hangup after deadlock avoidance, I have added some checks to detect
    those collisions and exit appropriately.  I think this patch is going to
    solve quite a bit of weirdness we have had with local channels in the past.
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_local.c