lucky-chen commented on a change in pull request #2824: [Android] Android] 
restart weexCoreThread when reload JSEngine becaus…
URL: https://github.com/apache/incubator-weex/pull/2824#discussion_r313767477
 
 

 ##########
 File path: 
android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
 ##########
 @@ -867,6 +867,14 @@ public int callRefreshFinish(String instanceId, String 
callback) {
 
   }
 
+  public void restartWeexCoreThread(){
+      WXLogUtils.e("weex","restartWeexCoreThread");
+      WXThread oldThread = mJSThread;
+      mJSThread = new WXThread("WeexJSBridgeThread", this);
+      mJSHandler = mJSThread.getHandler();
+      oldThread.quit();
 
 Review comment:
   1. HanderThread quit是比较安全的,remove 消息队列里面的所有消息,然后thread没有消息,loop结束,线程自然回收
   2. 灰度同步进行

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to