eolivelli commented on a change in pull request #1407:
URL: https://github.com/apache/zookeeper/pull/1407#discussion_r459413237



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
##########
@@ -469,6 +470,16 @@ private static String makeThreadName(String suffix) {
         return name + suffix;
     }
 
+    /**
+     * Tests that current thread is the main event loop.
+     * This method is useful only for tests inside ZooKeeper project
+     * it is not a public API intended for use by external applications.
+     * @return true if Thread.currentThread() is an EventThread.
+     */
+    public static boolean isInEventThread() {

Review comment:
       @symat 
   I made it public because I thought that this kind of assertions would be 
very useful while working on the EventThread.
   I also didn't want to move the test case, in order to limit the impact of 
the patch over the codebase.
   I will do it if you feel strong




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to