nfengine icon indicating copy to clipboard operation
nfengine copied to clipboard

Add Latch class to nfCommon

Open lookeypl opened this issue 10 years ago • 1 comments

Right now ThreadPool uses Latch as a synchronization point in tests. This class might be useful in other places.

  • [x] Create new Latch class based on the one used in ThreadPool tests
  • [x] Add tests if possible
  • [ ] Use WinAPI/pthread instead of STL
  • [ ] Allow for various types of synchronization:
    • [x] Waiting for single event
    • [x] Waiting until timeout occurs
    • [ ] Active waiting for event (probably will be rarely used, but sometimes in debugging might be helpful)
    • [ ] Waiting for N events
    • [ ] Combinations of mentioned above waiting types

lookeypl avatar Oct 16 '14 12:10 lookeypl

Windows part of this task may easily be done with events in WinAPI (CreateEvent(), SetEvent(), ResetEvent() and WaitForSingleObjectEx())

mkulagowski avatar Jul 27 '16 14:07 mkulagowski