neilcsmith-net commented on code in PR #9776: URL: https://github.com/apache/netbeans/pull/9776#discussion_r4502361039
########## ide/projectui/src/org/netbeans/modules/project/ui/actions/SetMainProject.java: ########## Review Comment: No, I'm looking at `refreshing`. It's for re-entry protection, but also not thread local. If an RP task is in flight, `refreshing` will be `true`. An EDT call to `isEnabled` will see `needsRefresh == true`, call through to `doRefresh()`, see `refreshing == true`, and return before the task has updated the action. There is a second potential race where a refresh on the RP has scheduled updates on the EDT that are queued after the event triggering the call to `isEnabled`. The RP sets `needsRefresh = false` before the tasks scheduled in `Mutex.EVENT` are executed. As I said, may not be a problem if stale data and eventual correctness is expected. Also looks like `refreshing` was made `volatile` but not `needsRefresh` unless GitHub is showing me a stale state. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
