Open daheige opened 3 years ago
https://github.com/gin-contrib/timeout/blob/e89e167737460b95d6b518d7583d2a321d1fc22b/timeout.go#L98 Which block of logic is the lock/unlock operation here, is it the write to dst, or the entire block from 100 lines to 109 lines? For timeout.go#L114, which is the same for the lock and release locks here? If it is for data writing/reading, see if you use mu sync.Mutex here, can you use rw lock?
https://github.com/gin-contrib/timeout/blob/e89e167737460b95d6b518d7583d2a321d1fc22b/timeout.go#L98 Which block of logic is the lock/unlock operation here, is it the write to dst, or the entire block from 100 lines to 109 lines? For timeout.go#L114, which is the same for the lock and release locks here? If it is for data writing/reading, see if you use mu sync.Mutex here, can you use rw lock?