Re: thread::mutex lock problem, a bug?
- From: "Zoran Vasiljevic" <zv@xxxxxxxxxxxxx>
- Date: 9 Feb 2006 00:29:31 -0800
OK. I now understand why I did not get the problem before.
Yes, there is again an race condition there. I'm afraid I'm
trying to be too clever at one place. I guess I will have to
remove that check eventually...
The reason I never spotted that problem was: normally you need
not lock the mutex before calling the [thread::cond notify].
So in your Thread2 and Thread3, locking of the mutex can be
avoided. But, as an exercise, this has revealed yet-another
race which I obviously added by doing the last changes.
Well, I said there might be new bugs introdoced...
I will have to see wether it is possible at all to fix that so that
the error gets triggered if somebody is trying to wait on the
cond variable w/o locking the mutex before. If not, I will remove
that check altogether.
.
- References:
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- From: Zoran Vasiljevic
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- From: Zoran Vasiljevic
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- From: Zoran Vasiljevic
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- From: Zoran Vasiljevic
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- Prev by Date: Re: widget destructor
- Next by Date: Re: "\" problems from argv
- Previous by thread: Re: thread::mutex lock problem, a bug?
- Next by thread: Re: thread::mutex lock problem, a bug?
- Index(es):
Relevant Pages
|
|