pan3793 commented on code in PR #5002:
URL: https://github.com/apache/kyuubi/pull/5002#discussion_r1261903864


##########
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:
   ```
     def runInNewThread(
         threadName: String,
         isDaemon: Boolean = true)(body: => Unit): Unit = {
       
       val thread = new Thread(threadName) {
         override def run(): Unit = {
           body
         }
       }
       thread.setDaemon(isDaemon)
       
thread.setUncaughtExceptionHandler(NamedThreadFactory.kyuubiUncaughtExceptionHandler)
       thread.start()
     }
   ```



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