[pve-devel] [PATCH common] add upid_wait method

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jan 22 17:23:14 CET 2016



On 01/22/2016 05:02 PM, Dietmar Maurer wrote:
>> waitfunc gets called every wait cycle, can be used for outputting/
>> logging something.
> in general, sleep() can/is interrupted by signals, so waitfunc() gets
> called at each interrupt - not sure if that is expected behavior?

Hmm, true not that good... The code could falsely let someone rely that 
waitfunc only gets called after 'sleep_intervall' seconds...

As sleep returns the seconds actually slept we could save the return 
value after the sleep call
and only call waitfunc if we slept for $sleep_intervall seconds? or 
checking if $! != EINTR.

Or is there a better way?





More information about the pve-devel mailing list