Re: Restart pg_usleep when interrupted
| От | Nathan Bossart |
|---|---|
| Тема | Re: Restart pg_usleep when interrupted |
| Дата | |
| Msg-id | Zo_7blmO166ZDGbW@nathan обсуждение исходный текст |
| Ответ на | Re: Restart pg_usleep when interrupted (Sami Imseih <samimseih@gmail.com>) |
| Ответы |
Re: Restart pg_usleep when interrupted
|
| Список | pgsql-hackers |
+ /* + * We allow nanosleep to handle interrupts and retry with the remaining time. + * However, since nanosleep is susceptible to time drift when interrupted + * frequently, we add a safeguard to break out of the nanosleep whenever the + * total time of the sleep exceeds the requested sleep time. Using nanosleep + * is a more portable approach than clock_nanosleep. + */ I'm curious why we wouldn't just subtract "elapsed_time" from "delay" at the bottom of the while loop to avoid needing this extra check. Also, I think we need some commentary about why we want to retry after an interrupt in this case. -- nathan
В списке pgsql-hackers по дате отправления: