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]

timed select() / timed wait on a CV


If select() is called with a timeout value ,the timed wait routine
of the condition variable 'selwait' is called with locked scheduler.

This routine doesn't respect the current scheduler lock count
which causes some errors:
- it doesn't sleep in wait_inner()
- it clears the sleep timer, which forces an unlimited sleep whenever the
  lock count of the scheduler lock goes zero
- it acquires the mutex lock before actually sleeping in select(),
  which prevents other threads to be awoken from select().

Adding a check of a variable "current_lock" corrects this behaviour.
Compare the untimed version (mutex.cxx, rev. 1.8, comment lines #547-550,
code lines #560-564, #629-631).

Jörg Tröger



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