Another macOS std::list boost::thread SNAFU.
[dcpomatic.git] / src / lib / event_history.cc
index eb3438aaba1397b747554b31b25d21e4b92c8c4e..efe80b243ce53f328609b1d8be2af1975a725b79 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 #include "util.h"
 #include <boost/thread/mutex.hpp>
 
+using boost::optional;
+
 EventHistory::EventHistory (int size)
        : _size (size)
 {
 
 }
 
-float
+optional<float>
 EventHistory::rate () const
 {
        boost::mutex::scoped_lock lock (_mutex);
        if (int (_history.size()) < _size) {
-               return 0;
+               return optional<float>();
        }
 
        struct timeval now;