Menu

Interrupting a Blocking-Mutex/Semaphore-Entry

Help
2002-03-11
2002-03-15
  • Matthias Ivers

    Matthias Ivers - 2002-03-11

    Hi,

    just wondering how I could implement an algorithm that waits on a Mutex/Semaphore only for ... say 10 seconds and then goes on.

    Most accuratly it could be described as a tryEnterMutex/tryWait() with a timeout :-)

     
    • Matthias Ivers

      Matthias Ivers - 2002-03-15

      okay... found a workaround! Conditional should do this! (at least on a POSIX system)... however it would be nice if Mutex implemented EnterMutex(timeout_t timeout=0)...
      (or maybe TryEnterMutex(timeout_t timeout=0)), since one has to consider the usage of a conditional, although a mutex is sufficient, bad hackery.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.