You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jsrc/ct.c
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -740,12 +740,13 @@ ASSERT(0,EVNONCE)
740
740
break;}
741
741
case14: { // threadpool keepwarm (in sec): set to y, return previous value
742
742
#ifPYXES
743
+
#defineMAXLINGER 0.1 // maximum time we will allow for lingering
743
744
ASSERT(AR(w)==1,EVRANK) ASSERT(AN(w)==2,EVLENGTH) // arg is threadpool# keepwarm
744
745
if(AT(w)!=FL)RZ(w=cvt(FL,w)); // make arg float type
745
746
Ddpoolno=DAV(w)[0]; Ipoolno=(I)dpoolno; ASSERT((D)poolno==dpoolno,EVDOMAIN) ASSERT(BETWEENO(poolno,0,MAXTHREADPOOLS),EVLIMIT) // extract threadpool# and audit it
746
747
JOBQ*jobq=&(*JT(jt,jobqueue))[poolno];
747
748
Doldval=jobq->keepwarmns*1e-9;
748
-
Dkwtime=DAV(w)[1]; ASSERT(kwtime>=0,EVDOMAIN); if(kwtime>0.003)kwtime=0.003; Ikwtimens=(I)(kwtime*1000000000); // limit time to 3ms and convert to ns
749
+
Dkwtime=DAV(w)[1]; ASSERT(kwtime>=0,EVDOMAIN); if(unlikely(kwtime>MAXLINGER))kwtime=MAXLINGER; Ikwtimens=(I)(kwtime*1000000000); // limit time and convert to ns
0 commit comments