threadpool
threadpool copied to clipboard
Close func may cause a panic
//TODO: need to check the existing /running task before closing the threadpool
And the threadPool close func has a problem in this scenario if the close func is called and the theaterPool is closed and thecase job := <-w.jobChannel:at the same time, the return select case may not be picked, so next for range will execute and the worker still can send to the worker channel, and it will panic.