Menu

sigwait portability

Porting
2001-11-14
2001-12-04
  • Frediano Ziglio

    Frediano Ziglio - 2001-11-14

    I'm trying to compile CommonC++ with cygwin (gcc utility and related ported to windows) but sigwait don't work. How to implement sigwait using sigsuspend (supported) ??

    Something like

    void wait(signo_t signo)
    {
      sigset_t mask, old;

      sigemptyset(&mask);
      sigaddset(&mask, signo);
      pthread_sigmask(SIG_BLOCK, &mask, &old);
      sigsuspend(&mask);
      pthread_sigmask(SIG_UNBLOCK, &old, &mask);
    }

    instead of

    void    wait(signo_t signo)
    {
        sigset_t mask;

        sigemptyset(&mask);
        sigaddset(&mask, signo);
        sigwait(&mask, &signo);
    }

    work (I'm not a posix guru...) ???

     
    • David Sugar

      David Sugar - 2001-12-04

      In this one case it might be interesting to see if a hybradized operation could be done in cygwin.  I think sigwait is only needed to support suspend/resume functionality in pthreads.  If one can extract the win32 "handle" for the pthread thread context in cygwin, one could do a native win32 thread suspend and resume call.

       
    • Frediano Ziglio

      Frediano Ziglio - 2001-12-04

      Well, yesterday I tried to compile on a MacOsX (sf compile farm) and have the same problem (not sigwait). Also in MacOsX pthread_kill are not declared, so PosixThread do not compile...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.