Re: strange behaviour with pthread_cond_wait()

From: Daniel Eischen (deischen_at_freebsd.org)
Date: 08/31/05

  • Next message: Daniel Valencia: "Re: strange behaviour with pthread_cond_wait()"
    Date: Tue, 30 Aug 2005 20:48:18 -0400 (EDT)
    To: Daniel Valencia <fetrovsky@yahoo.com>
    
    

    On Tue, 30 Aug 2005, Daniel Valencia wrote:

    > Hello, everybody...
    >
    > I have this multithreaded program, and there are these
    > two threads that work together with a queue. The
    > backend receive thread reads packets and pushes them
    > into the queue, while the frontend thread pops them
    > off the queue to hand them to the caller. This is an
    > implementation of a software switch.
    >
    > The issue is, i have this little piece of code in the
    > thread which actually performs the popping:

    [ ... ]

    > And when I runn my program, it will immediately exit.
    > The message is:
    >
    > pthread_cond_wait: Unknown error: 0
    >
    > Not only that: the returned value (e) is 1, while
    > EINVAL is 22. According to the man pages, if

    1 is EPERM.

    And from the POSIX Spec (see
    http://www.opengroup.org/onlinepubs/009695399/toc.htm):

      [EPERM]
          The mutex was not owned by the current thread at
          the time of the call.

    I suggest Butenhof's "Programming with POSIX Threads" book.

    -- 
    DE
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Daniel Valencia: "Re: strange behaviour with pthread_cond_wait()"

    Relevant Pages

    • strange behaviour with pthread_cond_wait()
      ... I have this multithreaded program, ... two threads that work together with a queue. ... Do You Yahoo!? ... Mail has the best spam protection around ...
      (freebsd-hackers)
    • Re: strange behaviour with pthread_cond_wait()
      ... > I have this multithreaded program, and there are these two threads ... > that work together with a queue. ... The backend receive thread reads ... compilable program. ...
      (freebsd-hackers)