maedhroz commented on code in PR #4902:
URL: https://github.com/apache/cassandra/pull/4902#discussion_r3482806119


##########
src/java/org/apache/cassandra/concurrent/CassandraThread.java:
##########
@@ -27,19 +27,33 @@ public class CassandraThread extends FastThreadLocalThread
     private ThreadLocalMetrics threadLocalMetrics;
     private ExecutorLocals executorLocals;
 
-    public CassandraThread(ThreadGroup group, Runnable target, String name)
+    private final ImmediateTaskHolder immediateTaskHolder;
+
+    public CassandraThread(ThreadGroup group, Runnable target, String name, 
ImmediateTaskHolder immediateTaskHolder)
     {
         super(group, target, name);
+        this.immediateTaskHolder = immediateTaskHolder;
+    }
+    public CassandraThread(ThreadGroup group, Runnable target, String name)
+    {
+        this(group, target, name, null);
     }
 
     public CassandraThread()
     {
         super();
+        this.immediateTaskHolder = null;
     }
 
     public CassandraThread(Runnable target)
     {
         super(target);
+        this.immediateTaskHolder = null;
+    }
+
+    public ImmediateTaskHolder getImmediateTaskHolder()
+    {
+        return immediateTaskHolder == null ? ImmediateTaskHolder.NO_OP : 
immediateTaskHolder;

Review Comment:
   nit: Can we just set `NO_OP` directly in the constructors above (and make 
passing `null` illegal) so we don't have to do this check?



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

Reply via email to