This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Nested calls to Mutexes
- To: rosimildo at hotmail dot com
- Subject: Re: [ECOS] Nested calls to Mutexes
- From: Bart Veer <bartv at redhat dot com>
- Date: Wed, 21 Mar 2001 13:29:28 GMT
- Cc: ecos-discuss at sourceware dot cygnus dot com
- References: <F309LwxTQTYkWSzsVA2000068c5@hotmail.com>
- Reply-To: bartv at redhat dot com
>>>>> "Rosimildo" == Rosimildo daSilva <rosimildo@hotmail.com> writes:
Rosimildo> Hi, the project I am working on, we have faced a small problem
Rosimildo> with mutexes.
>> From ecos documentation:
Rosimildo> "When a thread locks a mutex it becomes the owner. Only
Rosimildo> the mutex's owner may unlock it. While a mutex remains
Rosimildo> locked, the owner should not lock it again, as the
Rosimildo> behavior is undefined and probably dangerous. "
Rosimildo> I disagree with this statement. It is a *common idiom*
Rosimildo> to have routines that needs to "lock" some access to
Rosimildo> start calling other routines that "locks" the mutex
Rosimildo> again. In any sizeable project, this happens
Rosimildo> eventually. As long as the acquire()/release() calls
Rosimildo> are balanced, it should be no problem.
This issue has been raised before. See e.g.
http://sources.redhat.com/ml/ecos-discuss/2000-06/msg00333.html
and
http://sources.redhat.com/ml/ecos-discuss/2000-08/msg00061.html
There are no plans to change eCos' behaviour in this respect.
Bart