nfengine
nfengine copied to clipboard
Add Latch class to nfCommon
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
Windows part of this task may easily be done with events in WinAPI (CreateEvent(), SetEvent(), ResetEvent() and WaitForSingleObjectEx())