You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/08/14 08:47:13 UTC

[GitHub] [incubator-weex] lucky-chen commented on a change in pull request #2824: [Android] Android] restart weexCoreThread when reload JSEngine becaus…

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_r313767326
 
 

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


With regards,
Apache Git Services