File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ func setCache(re string, reg pcre.Regexp){
6969
7070 writingCache ++
7171
72+ time .Sleep (1000 )
73+
7274 if writingCache != 1 {
7375 writingCache --
7476 go setCache (re , reg )
Original file line number Diff line number Diff line change @@ -33,13 +33,15 @@ func TestReplace(t *testing.T) {
3333
3434func TestConcurent (t * testing.T ) {
3535 for i := 0 ; i < 10 ; i ++ {
36- go (func (){
37- res := RepFunc ([]byte ("test" ), `(t)` , func (data func (int ) []byte ) []byte {
38- return data (1 )
39- })
40- fmt .Println (string (res ))
41- })()
42- }
36+ for i := 0 ; i < 10 ; i ++ {
37+ go (func (){
38+ res := RepFunc ([]byte ("test" ), `(t)` , func (data func (int ) []byte ) []byte {
39+ return data (1 )
40+ })
41+ fmt .Println (string (res ))
42+ })()
43+ }
4344
44- time .Sleep (1000000 * 1000 ) // 1 second
45+ time .Sleep (1000000 * 1000 ) // 1 second
46+ }
4547}
You can’t perform that action at this time.
0 commit comments