VirtualBox

Changeset 86725 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Oct 28, 2020 9:21:24 AM (4 years ago)
Author:
vboxsync
Message:

IPRT/thread-posix.cpp: siginterrupt is deprecated, replace with sigaction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r82968 r86725  
    194194                    RT_ZERO(SigAct);
    195195                    SigAct.sa_handler = rtThreadPosixPokeSignal;
    196                     SigAct.sa_flags   = 0;
     196                    SigAct.sa_flags   = 0;      /* no SA_RESTART! */
    197197                    sigfillset(&SigAct.sa_mask);
    198198
     
    249249        sigprocmask(SIG_BLOCK, &SigSet, NULL);
    250250    }
    251 #ifdef RTTHREAD_POSIX_WITH_POKE
     251
     252#ifdef RTTHREAD_POSIX_WITH_POKE
     253    /*
     254     * bird 2020-10-28: Not entirely sure we do this, but it makes sure the signal works
     255     *                  on the new thread.  Probably some pre-NPTL linux reasons.
     256     */
    252257    if (g_iSigPokeThread != -1)
     258    {
     259# if 1 /* siginterrupt() is typically implemented as two sigaction calls, this should be faster and w/o deprecations: */
     260        struct sigaction SigActOld;
     261        RT_ZERO(SigActOld);
     262
     263        struct sigaction SigAct;
     264        RT_ZERO(SigAct);
     265        SigAct.sa_handler = rtThreadPosixPokeSignal;
     266        SigAct.sa_flags   = 0;          /* no SA_RESTART! */
     267        sigfillset(&SigAct.sa_mask);
     268
     269        int rc = sigaction(g_iSigPokeThread, &SigAct, &SigActOld);
     270        AssertMsg(rc == 0, ("rc=%Rrc errno=%d\n", RTErrConvertFromErrno(errno), errno));
     271        AssertMsg(rc || SigActOld.sa_handler == rtThreadPosixPokeSignal, ("%p\n", SigActOld.sa_handler));
     272# else
    253273        siginterrupt(g_iSigPokeThread, 1);
     274# endif
     275    }
    254276#endif
    255277}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette