Skip to content

Commit

Permalink
all: documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Dec 11, 2019
1 parent 3a8e6bf commit 9d8234c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions mkill.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
pid = os.Getpid()
maxThread = int32(runtime.NumCPU())
interval = time.Second
debug = true
debug = false
)

func checkwork() {
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 9d8234c

Please sign in to comment.