On Thu, 11 Mar 2021 10:39:56 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

> I guess having "FALSE" as fAsynchronous value mean the function does not 
> return until a change has occurred so do we still need this do-while 
> monitoring loop?

You're right, `FALSE` for `fAsynchronous` means the function doesn't return 
until a change occurred.

If a change occurs, we refresh the list of print services and then start to 
wait again. If we exit the loop, we'll not catch other changes that may occur.

> And if the function fails once, should we stop monitoring?
I followed Sergey's approach in `notifyLocalPrinterChange`, namely if 
`FindNextPrinterChangeNotification` returns an error, we quit the loop.

I can't see how we can fix the error if it occurs. Will it succeed the next 
time? Probably not. Thus I decided to quit the loop in case of an error.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2915

Reply via email to