[OpenJDK 2D-Dev] RFR: 8263311: Watch registry changes for remote printers update instead of polling

Alexey Ivanov aivanov at openjdk.java.net
Thu Mar 11 10:57:07 UTC 2021


On Thu, 11 Mar 2021 10:39:56 GMT, Prasanta Sadhukhan <psadhukhan at 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


More information about the 2d-dev mailing list