This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Timeslicing with mutexes
- From: Stijn Symons <stijn dot symons at acunia dot com>
- To: ecos-discuss <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 25 Feb 2002 15:16:21 +0100
- Subject: [ECOS] Timeslicing with mutexes
- Organization: Acunia
Hi all,
I have a stange situation at hand. I have to implement a method to lock
a mutex with a timeout. I do this with 2 mutexes and a condition
variable. When the mutex is locked by thread 1 and thread 2 wants to
lock, i wait for a period (timeout ticks) with the cyg_cond_timed_wait
function.
My mutex_unlock function will signal the condition if it's unlocked. So
i presume that when i give this signal, the timed_wait will continue
directly without waiting for the timeslice to go off.
But when I test it, it doesn't work. So does ecos continue until the
timeslice is over or will it directly go to the code after the
cyg_cond_timed_wait function?
thanks in advance,
stijn
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss