File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ type poolCommon struct {
191191 ticktockCtx context.Context
192192 stopTicktock context.CancelFunc
193193
194- now atomic. Value
194+ now int64
195195
196196 options * Options
197197}
@@ -303,7 +303,7 @@ func (p *poolCommon) ticktock() {
303303 break
304304 }
305305
306- p .now . Store ( time .Now ())
306+ atomic . StoreInt64 ( & p .now , time .Now (). UnixNano ())
307307 }
308308}
309309
@@ -318,13 +318,13 @@ func (p *poolCommon) goPurge() {
318318}
319319
320320func (p * poolCommon ) goTicktock () {
321- p .now . Store ( time .Now ())
321+ atomic . StoreInt64 ( & p .now , time .Now (). UnixNano ())
322322 p .ticktockCtx , p .stopTicktock = context .WithCancel (context .Background ())
323323 go p .ticktock ()
324324}
325325
326326func (p * poolCommon ) nowTime () time.Time {
327- return p . now . Load ().(time. Time )
327+ return time . Unix ( 0 , atomic . LoadInt64 ( & p . now ) )
328328}
329329
330330// Running returns the number of workers currently running.
You can’t perform that action at this time.
0 commit comments