[En-Nut-Discussion] Feature Request 1572837: mutex API nesting level info
duane ellis
ethernut at duaneellis.com
Sat Jul 19 02:05:42 CEST 2008
Bernard Fouché wrote:
> Hi,
>
> FYI, here is the point of view of eCos designers about recursive mutexes
> (taken from http://ecos.sourceware.org/docs-latest/ref/kernel-mutexes.html):
> ---
>
POSIX threads solved this along time ago. POSIX threads lets you many
types of MUTEXes.
int pthread_mutex_init(pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr);
Where ATTRIBUTE is one of:
NULL - you get some default
Or NOT NULL, and was specified via pthread_mutexattr_settype() as one of:
PTHREAD_MUTEX_NORMAL
PTHREAD_MUTEX_ERRORCHECK
PTHREAD_MUTEX_RECURSIVE
PTHREAD_MUTEX_DEFAULT
See:
http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_mutexattr_settype.html
** Yes, NUT is not Pthreads.
But NUT can certainly learn from - pthreads. It is a well thought out
solution, that has passed the many eyeballs test.
One can learn from this.
-Duane.
More information about the En-Nut-Discussion
mailing list