[En-Nut-Discussion] Mutex Implementation anybody?

Matthias Ringwald mringwal at inf.ethz.ch
Thu Apr 15 18:49:34 CEST 2004


Hi,

sorry for sending that much emails, but:

does anybody uses something like a mutex?

it is quite simple to implement mutex semantics
with a struct consisting of a nut queue and a counter.
but if someone already did, I would save myself the work.

if not, any wishes how the calls should look like?

posix provides functions like this:
pthread_mutex_init
pthread_mutex_lock
...

For me, I will only need recursive mutexes

I would need:

mutex_init()
mutex_lock(mutex)
mutex_unlock(mutex)
mutex-trylock()

defining an mutex_destroy wouldn't hurt much.

so, comments on this?

matthias




More information about the En-Nut-Discussion mailing list