summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-08-20 01:58:51 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-08-20 01:58:51 +0900
commit87874bba88c315b11ce5da37c178e6fdedb8708a (patch)
tree05e00dc8f0550683dc02e02f7747c533c4bec44c /src/util
parentc304fc43333c95467394ca2d6e5eddbbcdf99e3d (diff)
Remove redundant read event when --sync is used
Diffstat (limited to 'src/util')
-rw-r--r--src/util/eventbox.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/eventbox.go b/src/util/eventbox.go
index b710cf1e..acd95616 100644
--- a/src/util/eventbox.go
+++ b/src/util/eventbox.go
@@ -45,6 +45,13 @@ func (b *EventBox) Set(event EventType, value interface{}) {
b.cond.L.Unlock()
}
+// Unset turns off the event type on the box
+func (b *EventBox) Unset(event EventType) {
+ b.cond.L.Lock()
+ delete(b.events, event)
+ b.cond.L.Unlock()
+}
+
// Clear clears the events
// Unsynchronized; should be called within Wait routine
func (events *Events) Clear() {