Skip to content
Snippets Groups Projects
  • Nadav Har'El's avatar
    7890e39a
    Added timeout parameter to semaphore::wait() · 7890e39a
    Nadav Har'El authored
    Added a timeout parameter to semaphore::wait(), which defaults to no
    timeout.
    
    semaphore:wait() is now a boolean, just like trywait(), and likewise can
    return false when the semaphore has not actually been decremented but
    rather we had a timeout.
    
    Because we need the mutex again after the wait, I replaced the "with_lock"
    mechanism by the better-looking lock_guard and mutex parameter to
    wait_until.
    7890e39a
    History
    Added timeout parameter to semaphore::wait()
    Nadav Har'El authored
    Added a timeout parameter to semaphore::wait(), which defaults to no
    timeout.
    
    semaphore:wait() is now a boolean, just like trywait(), and likewise can
    return false when the semaphore has not actually been decremented but
    rather we had a timeout.
    
    Because we need the mutex again after the wait, I replaced the "with_lock"
    mechanism by the better-looking lock_guard and mutex parameter to
    wait_until.