Boost logo

Threads-Devel :

Subject: [Threads-devel] may be a bug in boost.thread on freebsd 8.0
From: å×ÇÅÎÉÊ ûÕÂÉÎ (shubin_evgeniy_at_[hidden])
Date: 2010-07-28 08:15:52


I use boost1.43 on freebsd8.0 amd64, installed from ports.
Here is a simple program that causes an assertion:

  Assertion failed: (!pthread_cond_wait(&cond,m.mutex()->native_handle())), function wait, file ./boost/thread/pthread/condition_variable.hpp, line 20.

during execution.

#include <boost/thread.hpp>
#include <cstdlib>

using namespace std;

void ThreadFun(int number)
{
    sleep(5);
}

int main(int argc, char** argv)
{
    if (argc > 1)
    {
        pid_t pid = fork();
        if (pid < 0)
        {
            return EXIT_FAILURE;
        }
        else if (pid > 0)
        {
            return EXIT_SUCCESS;
        }
    }
    boost::thread th1(boost::bind(&ThreadFun, 1));
    th1.join();
    return EXIT_SUCCESS;
}

Error occurs only when I execute program with command line arguments(when the process forks)
and only on freebsd 8.0 (on ubuntu 10.04 x64 and on freebsd 7.3 amd 64 it works correct).

Is it a bug or did something wrong?
Thanks.




Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk