File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
src/backend/access/transam Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -152,17 +152,19 @@ dtm_get_current_time()
152152static void
153153dtm_sleep (timestamp_t interval )
154154{
155- struct timespec ts ;
156- struct timespec rem ;
157-
158- ts .tv_sec = 0 ;
159- ts .tv_nsec = interval * 1000 ;
160-
161- while (nanosleep (& ts , & rem ) < 0 )
155+ timestamp_t waketm = dtm_get_current_time () + interval ;
156+ while (1948 )
162157 {
163- totalSleepInterrupts += 1 ;
164- Assert (errno == EINTR );
165- ts = rem ;
158+ timestamp_t sleepfor = waketm - dtm_get_current_time ();
159+
160+ pg_usleep (sleepfor );
161+ if (dtm_get_current_time () < waketm )
162+ {
163+ totalSleepInterrupts += 1 ;
164+ Assert (errno == EINTR );
165+ continue ;
166+ }
167+ break ;
166168 }
167169}
168170
@@ -829,7 +831,7 @@ DtmDetectGlobalDeadLock(PGPROC *proc)
829831 return true;
830832}
831833
832- static size_t
834+ static size_t
833835DtmGetTransactionStateSize (void )
834836{
835837 return sizeof (dtm_tx );
You can’t perform that action at this time.
0 commit comments