incubator-weex git commit: [WEEX-189][iOS] optimize threadSafe dictionary

2018-01-25 Thread acton393
Repository: incubator-weex
Updated Branches:
  refs/heads/master c9a182f38 -> 4e7f0d55f


[WEEX-189][iOS] optimize threadSafe dictionary

Bug:189

[WEEX-189][iOS] remove useless line


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/4e7f0d55
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/4e7f0d55
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/4e7f0d55

Branch: refs/heads/master
Commit: 4e7f0d55f01d4336d46e87f9a795e504e833edc1
Parents: c9a182f
Author: acton393 
Authored: Fri Jan 26 15:27:06 2018 +0800
Committer: acton393 
Committed: Fri Jan 26 15:36:06 2018 +0800

--
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m   | 2 +-
 ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m | 5 -
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4e7f0d55/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
--
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m 
b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index da9275d..45fde5f 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -228,7 +228,7 @@ typedef enum : NSUInteger {
 if ([configCenter 
respondsToSelector:@selector(configForKey:defaultValue:isDefault:)]) {
 BOOL useCoreText = [[configCenter 
configForKey:@"iOS_weex_ext_config.text_render_useCoreText" defaultValue:@YES 
isDefault:NULL] boolValue];
 [WXTextComponent setRenderUsingCoreText:useCoreText];
-BOOL useThreadSafeLock = [[configCenter 
configForKey:@"iOS_weex_ext_config.useThreadSafeLock" defaultValue:@NO 
isDefault:NULL] boolValue];
+BOOL useThreadSafeLock = [[configCenter 
configForKey:@"iOS_weex_ext_config.useThreadSafeLock" defaultValue:@YES 
isDefault:NULL] boolValue];
 [WXUtility setThreadSafeCollectionUsingLock:useThreadSafeLock];
 }
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4e7f0d55/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
--
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m 
b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
index fb4185e..21da6a0 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
@@ -26,7 +26,7 @@
 {
 pthread_mutex_t _safeThreadDictionaryMutex;
 pthread_mutexattr_t _safeThreadDictionaryMutexAttr;
-os_unfair_lock _unfairLock;
+os_unfair_lock _unfairLock;// this type of lock is not recurisive
 }
 
 @property (nonatomic, strong) dispatch_queue_t queue;
@@ -124,6 +124,9 @@
 
 - (id)objectForKey:(id)aKey
 {
+if (nil == aKey){
+return nil;
+}
 __block id obj;
 if (![WXUtility threadSafeCollectionUsingLock]) {
 dispatch_sync(_queue, ^{

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4e7f0d55/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
--
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m 
b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
index 64c6862..dd3a35d 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -41,7 +41,7 @@
 #define KEY_PASSWORD  @"com.taobao.Weex.123456"
 #define KEY_USERNAME_PASSWORD  @"com.taobao.Weex.weex123456"
 
-static BOOL threadSafeCollectionUsingLock = NO;
+static BOOL threadSafeCollectionUsingLock = YES;
 
 void WXPerformBlockOnMainThread(void (^ _Nonnull block)(void))
 {



[GitHub] incubator-weex issue #1005: [WEEX-189][iOS] optimize threadSafe dictionary

2018-01-25 Thread weex-bot
Github user weex-bot commented on the issue:

https://github.com/apache/incubator-weex/pull/1005
  





  

  
  Warnings

  
  
  :warning:
  No Changelog changes!

  

  :warning:
  This PR should update related documents as well. 

  




  

  
  Messages

  
  
  :book:
  danger test finished.

  




  Generated by :no_entry_sign: http://github.com/danger/danger-js/;>dangerJS




---


[GitHub] incubator-weex pull request #1005: [WEEX-189][iOS] optimize threadSafe dicti...

2018-01-25 Thread acton393
GitHub user acton393 opened a pull request:

https://github.com/apache/incubator-weex/pull/1005

[WEEX-189][iOS] optimize threadSafe dictionary

optimize threadSafe dictionary
Bug:189

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/acton393/incubator-weex ios-feature-lock

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-weex/pull/1005.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1005


commit 797675892ca969226f9c36de56fb387643c7caf2
Author: acton393 
Date:   2018-01-26T07:27:06Z

[WEEX-189][iOS] optimize threadSafe dictionary

Bug:189




---


[GitHub] incubator-weex pull request #1004: JsService should be registered during wee...

2018-01-25 Thread Darin726
GitHub user Darin726 opened a pull request:

https://github.com/apache/incubator-weex/pull/1004

JsService should be registered during weex reload

An app may reload weex sdk in some situation.

So we should register js service during  weex sdk reloading

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/Darin726/incubator-weex master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-weex/pull/1004.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1004






---