This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Nested calls to Mutexes


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]