File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11# mkill
22
3- mkill limites the number of threads in a Go program
3+ mkill limits the number of threads in a Go program
4+
5+ ## Usage
6+
7+ ```
8+ mkill.GOMAXTHREADS(50)
9+ ```
10+
11+ ## License
12+
13+ MIT © ; Changkun Ou
Original file line number Diff line number Diff line change 1515 pid = os .Getpid ()
1616 maxThread = int32 (runtime .NumCPU ())
1717 interval = time .Second
18- debug = true
18+ debug = false
1919)
2020
2121func checkwork () {
@@ -57,7 +57,7 @@ func init() {
5757 }()
5858}
5959
60- // GOMAXTHREADS change the limites of the maximum threads in runtime
60+ // GOMAXTHREADS change the limits of the maximum threads in runtime
6161// and returns the previous number of threads limit
6262func GOMAXTHREADS (n int ) int {
6363 return int (atomic .SwapInt32 (& maxThread , int32 (n )))
You can’t perform that action at this time.
0 commit comments