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]

Timeslicing with mutexes


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


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