Add console throttling; closes pterodactyl/panel#2214 (#60)

This commit is contained in:
Dane Everitt
2020-09-17 20:13:04 -07:00
committed by GitHub
parent ce76b9339e
commit 6ba1b75696
8 changed files with 191 additions and 60 deletions

20
system/bool.go Normal file
View File

@@ -0,0 +1,20 @@
package system
import "sync/atomic"
type AtomicBool struct {
flag uint32
}
func (ab *AtomicBool) Set(v bool) {
i := 0
if v {
i = 1
}
atomic.StoreUint32(&ab.flag, uint32(i))
}
func (ab *AtomicBool) Get() bool {
return atomic.LoadUint32(&ab.flag) == 1
}