[BACK]Return to patch-main_bridge__channel.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / comms / asterisk16 / patches

Annotation of pkgsrc/comms/asterisk16/patches/patch-main_bridge__channel.c, Revision 1.1

1.1     ! ryoon       1: $NetBSD$
        !             2:
        !             3: * Fix segfault under NetBSD/aarch64 9.99.80.
        !             4:
        !             5: --- main/bridge_channel.c.orig 2021-01-21 16:28:04.000000000 +0000
        !             6: +++ main/bridge_channel.c
        !             7: @@ -58,6 +58,13 @@
        !             8:  #include "asterisk/stream.h"
        !             9:  #include "asterisk/message.h"
        !            10:
        !            11: +/* XXX, pthread_equal() is misused to compare non-valid thread pointers */
        !            12: +static int
        !            13: +pt_pthread_equal(pthread_t t1, pthread_t t2)
        !            14: +{
        !            15: +      return t1 == t2;
        !            16: +}
        !            17: +
        !            18:  /*!
        !            19:   * \brief Used to queue an action frame onto a bridge channel and write an action frame into a bridge.
        !            20:   * \since 12.0.0
        !            21: @@ -258,7 +265,7 @@ int ast_bridge_channel_notify_talking(st
        !            22:   */
        !            23:  static void bridge_channel_poke(struct ast_bridge_channel *bridge_channel)
        !            24:  {
        !            25: -      if (!pthread_equal(pthread_self(), bridge_channel->thread)) {
        !            26: +      if (!pt_pthread_equal(pthread_self(), bridge_channel->thread)) {
        !            27:                /* Wake up the bridge channel thread. */
        !            28:                ast_queue_frame(bridge_channel->chan, &ast_null_frame);
        !            29:        }
        !            30: @@ -971,7 +978,7 @@ static int bridge_channel_queue_action_d
        !            31:        };
        !            32:
        !            33:        /* Make sure we don't end up trying to wait on ourself to deliver the frame */
        !            34: -      ast_assert(!pthread_equal(pthread_self(), bridge_channel->thread));
        !            35: +      ast_assert(!pt_pthread_equal(pthread_self(), bridge_channel->thread));
        !            36:
        !            37:        sync_payload = ast_alloca(sync_payload_len);
        !            38:        sync_payload->id = ast_atomic_fetchadd_int(&sync_ids, +1);

CVSweb <webmaster@jp.NetBSD.org>