This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: pthread_mutex_unlock when mutex is not locked
- From: Sergei Organov <osv at topconrd dot ru>
- To: RubИn PИrez de Aranda Alonso <rperez at sidsa dot es>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 27 Apr 2005 12:30:10 +0400
- Subject: Re: [ECOS] pthread_mutex_unlock when mutex is not locked
- References: <426F4C4A.4020701@sidsa.es>
RubИn PИrez de Aranda Alonso <rperez@sidsa.es> writes:
> Hi all,
> I have found a problem when I want to unlock a mutex that is not locked
> by any thread.
Then the problem is in your code. The mutex is not appropriate for what
you are doing, -- only the thread that locked the mutex is allowed to
unlock it. Use something else, e.g., semaphore or condition variable to
achieve your goal.
--
Sergei.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss