Skip to content

Instantly share code, notes, and snippets.

View etam's full-sized avatar

Adam Mizerski etam

View GitHub Profile
@etam
etam / monitor.cpp
Last active August 29, 2015 13:56
C++14 monitor class with multiple readers, single writers access control
/*
Based on Herb Sutter's monitor implementation presented on
https://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Herb-Sutter-Concurrency-and-Parallelism at 40:30,
which is, I hope, public domain.
*/
#include <utility>
#include <shared_mutex>