FW: Very serious problem with Cyg_Mutex::trylock(), when eCos is built with CYGDBG_USE_ASSERTS
After a few days of serious debugging, we think, that we have found, that eCos has a very serious problem with Cyg_Mutex::trylock(), when eCos is built with CYGDBG_USE_ASSERTS.
The problem has the impact, that when using cyg_mutex_trylock(), the system might die with an assert failed, although there is no reason for it.
Here is, what we have found:
When build with CYGDBG_USE_ASSERTS the Cyg_Mutex::check_this() method will check, that there is consistency between the instance variables "locked" and "owner". See code below (from file packages/kernel/.../src/sync/mutex.cxx). However, since this consistency check is not atomic, is must only be done, when thread switching is prohibited.