hdygxsj commented on PR #8703:
URL: https://github.com/apache/gravitino/pull/8703#issuecomment-3383975653

   Hi @bittu9975, I think using compareAndExchange is enough
   such as, 
   ```java
   public void loadRole(Runnable runnable) {
     if (hasLoadRole.compareAndSet(false, true)) {
       runnable.run();
     }
   }
   ```


-- 
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]

Reply via email to