diff options
author | Unknwon <u@gogs.io> | 2017-01-25 18:10:27 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-01-25 18:10:27 -0500 |
commit | ad57f188946c303787ee501a34791445b5c18a70 (patch) | |
tree | 78b9e64cfd6f424e243a66a6b9b7d1603be18185 | |
parent | 80cd8f6a291a145609ff77509a9cf2dc00ee9a1b (diff) |
modules/sync: minor field refactor
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | modules/sync/status_pool.go | 14 | ||||
-rw-r--r-- | modules/sync/unique_queue.go | 4 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
5 files changed, 12 insertions, 12 deletions
@@ -3,7 +3,7 @@ Gogs - Go Git Service [ -##### Current tip version: 0.9.117 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions ~~or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)~~) +##### Current tip version: 0.9.118 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions ~~or submit a task on [alpha stage automated binary building system](https://build.gogs.io/)~~) | Web | UI | Preview | |:-------------:|:-------:|:-------:| @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.117.0125" +const APP_VER = "0.9.118.0125" func init() { setting.AppVer = APP_VER diff --git a/modules/sync/status_pool.go b/modules/sync/status_pool.go index f6a7f949..2d729715 100644 --- a/modules/sync/status_pool.go +++ b/modules/sync/status_pool.go @@ -13,7 +13,7 @@ import ( // This table is particularly useful for un/marking and checking values // in different goroutines. type StatusTable struct { - lock sync.RWMutex + sync.RWMutex pool map[string]bool } @@ -26,24 +26,24 @@ func NewStatusTable() *StatusTable { // Start sets value of given name to true in the pool. func (p *StatusTable) Start(name string) { - p.lock.Lock() - defer p.lock.Unlock() + p.Lock() + defer p.Unlock() p.pool[name] = true } // Stop sets value of given name to false in the pool. func (p *StatusTable) Stop(name string) { - p.lock.Lock() - defer p.lock.Unlock() + p.Lock() + defer p.Unlock() p.pool[name] = false } // IsRunning checks if value of given name is set to true in the pool. func (p *StatusTable) IsRunning(name string) bool { - p.lock.RLock() - defer p.lock.RUnlock() + p.RLock() + defer p.RUnlock() return p.pool[name] } diff --git a/modules/sync/unique_queue.go b/modules/sync/unique_queue.go index 3f3c1c86..61b0aa5b 100644 --- a/modules/sync/unique_queue.go +++ b/modules/sync/unique_queue.go @@ -50,12 +50,12 @@ func (q *UniqueQueue) AddFunc(id interface{}, fn func()) { } idStr := com.ToStr(id) - q.table.lock.Lock() + q.table.Lock() q.table.pool[idStr] = true if fn != nil { fn() } - q.table.lock.Unlock() + q.table.Unlock() q.queue <- idStr } diff --git a/templates/.VERSION b/templates/.VERSION index 5d19b0cf..183b9ddf 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.117.0125
\ No newline at end of file +0.9.118.0125
\ No newline at end of file |