Boost logo

Boost Users :

Subject: Re: [Boost-users] boost recursive_mutex destructor call in child (forked) process
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-01-29 15:36:45


AMDG

On 1/28/2011 6:52 AM, Prince Singh wrote:
> I am facing a problem in using boost::recursive_mutex.
>
> Flow of my program is:-
>
> 1. Get a boost::recursive_mutex lock
> 2. Fork the process
> 3. In parent sleep for few seconds and then unlock
> boost::recursive_mutex.
> 4. In child call exit(0)
>
> What is happening is that child process is calling the destructor of
> boost::recursive_mutex
> and core is dumped. I want that child process should not inherit the boost
> mutex lock of parent.
> Please tell me how to do it.
>

I believe that you should call _exit in the child.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net