chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54c5cca
)
explain why PlayerUpdate interface
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 31 Jul 2020 22:02:08 +0000
(23:02 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 31 Jul 2020 22:02:08 +0000
(23:02 +0100)
src/updates.rs
patch
|
blob
|
history
diff --git
a/src/updates.rs
b/src/updates.rs
index 9246a7140bdf8a7567b711de4642e7b52e011cb3..86dc544151d7f9d0efeb4f7842366f1d28e742e0 100644
(file)
--- a/
src/updates.rs
+++ b/
src/updates.rs
@@
-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() }
}