Skip to content
  • Marius Gerbershagen's avatar
    multithreading: implement mutexes and condition variables using OS primitives · 0f737b6b
    Marius Gerbershagen authored
    Replace slow homegrown mutex implementation by standard OS functions.
    
    We try our best to be interrupt safe, however a completely safe
    implementation is impossible (unless one completely removes the ability
    to interrupt a thread waiting on a mutex). There is always a window
    after the OS specific function has returned, but before we can set
    the owner, in which interrupts will see an inconsistent state of the
    mutex with regards to owner and count.
    
    Condition variables are now based on OS functions as well. Timed
    waiting on condition variables has also been implemented.
    0f737b6b