Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Traun Leyden committed May 25, 2018
1 parent a67a9b9 commit eb5c138
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/change_cache.go
Expand Up @@ -677,7 +677,7 @@ func (c *changeCache) _addToCache(change *LogEntry) base.Set {
// Returns the channels that changed.
func (c *changeCache) _addPendingLogs() base.Set {
var changedChannels base.Set

for len(c.pendingLogs) > 0 {
change := c.pendingLogs[0]
isNext := change.Sequence == c.nextSequence
Expand Down Expand Up @@ -784,12 +784,14 @@ func (c *changeCache) SetInitialSequence(initialSequence uint64) {
c.nextSequence = initialSequence + 1
}

// Concurrent-safe get value of nextSequence
func (c *changeCache) getNextSequence() uint64 {
c.lock.RLock()
defer c.lock.RUnlock()
return c.nextSequence
}

// Concurrent-safe get value of initialSequence
func (c *changeCache) getInitialSequence() uint64 {
c.lock.RLock()
defer c.lock.RUnlock()
Expand Down

0 comments on commit eb5c138

Please sign in to comment.