Skip to content
  • Philippe Gerum's avatar
    cobalt/rtdm/mutex: fix rtdm_mutex_timedlock() · ef0992d6
    Philippe Gerum authored
    The fast path in rtdm_mutex_timedlock() was terminally broken by the
    not-so-recent addition of fast locks to RTDM-based kernel mutexes. As
    a matter of fact, the xnthread_try_grab() helper suffered multiple
    breakages, including the lack of update to the underlying fastlock
    word to reflect a successful locking operation.
    
    To this end, we introduce xnsynch_try_acquire() which properly
    attempts to grab the requested mutex on behalf of the current thread,
    and call it as a drop-in replacement for xnthread_try_grab().  Callers
    fall back to xnsynch_acquire() on failure to put a fast grab on the
    mutex.
    ef0992d6