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

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

1.1     ! ryoon       1: $NetBSD$
        !             2:
        !             3: * Fix segfault under NetBSD/aarch64 9.99.80.
        !             4:
        !             5: --- main/taskprocessor.c.orig  2021-01-21 16:28:04.000000000 +0000
        !             6: +++ main/taskprocessor.c
        !             7: @@ -37,6 +37,13 @@
        !             8:  #include "asterisk/taskprocessor.h"
        !             9:  #include "asterisk/sem.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 tps_task structure is queued to a taskprocessor
        !            20:   *
        !            21: @@ -263,7 +270,7 @@ static void default_listener_shutdown(st
        !            22:
        !            23:        ast_assert(pvt->poll_thread != AST_PTHREADT_NULL);
        !            24:
        !            25: -      if (pthread_equal(pthread_self(), pvt->poll_thread)) {
        !            26: +      if (pt_pthread_equal(pthread_self(), pvt->poll_thread)) {
        !            27:                res = pthread_detach(pvt->poll_thread);
        !            28:                if (res != 0) {
        !            29:                        ast_log(LOG_ERROR, "pthread_detach(): %s\n", strerror(errno));
        !            30: @@ -1268,7 +1275,7 @@ int ast_taskprocessor_is_task(struct ast
        !            31:        int is_task;
        !            32:
        !            33:        ao2_lock(tps);
        !            34: -      is_task = pthread_equal(tps->thread, pthread_self());
        !            35: +      is_task = pt_pthread_equal(tps->thread, pthread_self());
        !            36:        ao2_unlock(tps);
        !            37:        return is_task;
        !            38:  }

CVSweb <webmaster@jp.NetBSD.org>