pan3793 commented on code in PR #5002:
URL: https://github.com/apache/kyuubi/pull/5002#discussion_r1261901002
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/util/ThreadUtils.scala:
##########
@@ -95,4 +96,52 @@ object ThreadUtils extends Logging {
}
}
}
+
+ def runInNewThread[T](
+ threadName: String,
+ isDaemon: Boolean = true)(body: => T): T = {
+ @volatile var exception: Option[Throwable] = None
+ @volatile var result: T = null.asInstanceOf[T]
Review Comment:
in this case, this is kind of "run something in a new thread and forget it".
we don't care about the result.
since we don't want to block the current thread, the result T or exception
still be the initiate value after the function return.
--
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]