From 9d8234ccc62721e14296eaaddc9b2013b75df69a Mon Sep 17 00:00:00 2001 From: Changkun Ou Date: Wed, 11 Dec 2019 18:54:41 +0100 Subject: [PATCH] all: documentation --- README.md | 12 +++++++++++- mkill.go | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 06c46f9..8411a84 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # mkill -mkill limites the number of threads in a Go program +mkill limits the number of threads in a Go program + +## Usage + +``` +mkill.GOMAXTHREADS(50) +``` + +## License + +MIT © Changkun Ou \ No newline at end of file diff --git a/mkill.go b/mkill.go index a4f929b..4873bac 100644 --- a/mkill.go +++ b/mkill.go @@ -15,7 +15,7 @@ var ( pid = os.Getpid() maxThread = int32(runtime.NumCPU()) interval = time.Second - debug = true + debug = false ) func checkwork() { @@ -57,7 +57,7 @@ func init() { }() } -// GOMAXTHREADS change the limites of the maximum threads in runtime +// GOMAXTHREADS change the limits of the maximum threads in runtime // and returns the previous number of threads limit func GOMAXTHREADS(n int) int { return int(atomic.SwapInt32(&maxThread, int32(n)))