chiark / gitweb /
explain why PlayerUpdate interface
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 31 Jul 2020 22:02:08 +0000 (23:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 31 Jul 2020 22:02:08 +0000 (23:02 +0100)
src/updates.rs

index 9246a7140bdf8a7567b711de4642e7b52e011cb3..86dc544151d7f9d0efeb4f7842366f1d28e742e0 100644 (file)
@@ -98,6 +98,8 @@ impl PlayerUpdates {
     self.log.push_back(update.into());
     self.cv.notify_all();
   }
+  // giving out only immutable references means no-one can
+  // forget to cv.notify
   pub fn read_log(&self) -> &PlayerUpdatesLog { &self.log }
   pub fn get_cv(&self) -> Arc<Condvar> { self.cv.clone() }
 }