VirtualBox

Changeset 92507 in vbox for trunk/src


Ignore:
Timestamp:
Nov 19, 2021 1:57:29 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148373
Message:

IPRT/thread: Added RTThreadControlPokeSignal to help deal with RTTHREADFLAGS_NO_SIGNALS in NEM/linux mode. bugref:9044

File:
1 edited

Legend:

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

    r90392 r92507  
    641641
    642642#ifdef RTTHREAD_POSIX_WITH_POKE
     643
    643644RTDECL(int) RTThreadPoke(RTTHREAD hThread)
    644645{
     
    659660    return rc;
    660661}
     662
     663
     664RTDECL(int) RTThreadControlPokeSignal(RTTHREAD hThread, bool fEnable)
     665{
     666    AssertReturn(hThread == RTThreadSelf() && hThread != NIL_RTTHREAD, VERR_INVALID_PARAMETER);
     667    int rc;
     668    if (g_iSigPokeThread != -1)
     669    {
     670        sigset_t SigSet;
     671        sigemptyset(&SigSet);
     672        sigaddset(&SigSet, g_iSigPokeThread);
     673
     674        int rc2 = sigprocmask(fEnable ? SIG_UNBLOCK : SIG_BLOCK, &SigSet, NULL);
     675        if (rc2 == 0)
     676            rc = VINF_SUCCESS;
     677        else
     678        {
     679            rc = RTErrConvertFromErrno(errno);
     680            AssertMsgFailed(("rc=%Rrc errno=%d (rc2=%d)\n", rc, errno, rc2));
     681        }
     682    }
     683    else
     684        rc = VERR_NOT_SUPPORTED;
     685    return rc;
     686}
     687
     688
    661689#endif
    662690
Note: See TracChangeset for help on using the changeset viewer.

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