mirror of
https://github.com/eolinker/apinto
synced 2026-04-22 16:07:04 +08:00
16 lines
240 B
Go
16 lines
240 B
Go
package monitor_manager
|
|
|
|
import "sync/atomic"
|
|
|
|
type concurrency struct {
|
|
count int32
|
|
}
|
|
|
|
func (c *concurrency) Add(count int32) {
|
|
atomic.AddInt32(&c.count, count)
|
|
}
|
|
|
|
func (c *concurrency) Get() int32 {
|
|
return atomic.LoadInt32(&c.count)
|
|
}
|