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]
Other format: [Raw text]

Re: pthread_mutex_unlock when mutex is not locked


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


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