|
29 | 29 | * the requested delay to be rounded up to the next resolution boundary.
|
30 | 30 | *
|
31 | 31 | * On machines where "long" is 32 bits, the maximum delay is ~2000 seconds.
|
| 32 | + * |
| 33 | + * CAUTION: the behavior when a signal arrives during the sleep is platform |
| 34 | + * dependent. On most Unix-ish platforms, a signal does not terminate the |
| 35 | + * sleep; but on some, it will (the Windows implementation also allows signals |
| 36 | + * to terminate pg_usleep). And there are platforms where not only does a |
| 37 | + * signal not terminate the sleep, but it actually resets the timeout counter |
| 38 | + * so that the sleep effectively starts over! It is therefore rather hazardous |
| 39 | + * to use this for long sleeps; a continuing stream of signal events could |
| 40 | + * prevent the sleep from ever terminating. Better practice for long sleeps |
| 41 | + * is to use WaitLatch() with a timeout. |
32 | 42 | */
|
33 | 43 | void
|
34 | 44 | pg_usleep(longmicrosec)
|
|