[ECOS] timed select() / timed wait on a CV

Joerg Troeger jtroeger@nortelnetworks.com
Wed Sep 6 00:58:00 GMT 2000


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




More information about the Ecos-discuss mailing list