- handle panic in routine pool.

This commit is contained in:
gazebo
2018-06-29 09:18:09 +08:00
parent 3b36c74a29
commit 8c4e92f5ef
2 changed files with 21 additions and 11 deletions

View File

@@ -23,12 +23,12 @@ func init() {
}
func TestCallFun(t *testing.T) {
pool := New(10, 10)
for i := 0; i < 20; i++ {
pool := New(1000, 1000)
for i := 0; i < 200; i++ {
x := rand.Int()
pool.CallFun(func() {
x := i
sugarLogger.Debug(x)
}, utils.Int2Str(i))
}, utils.Int2Str(x))
}
pool.CallFun(func() {
sugarLogger.Debug(15)