title: @synchronized not working in MRC,my app crash in multithreaded
body: <pre><code>//person.h
  @interface Person : NSObject
  
  @property(retain, nonatomic) NSString *indexStr;
  
  - (instancetype)initWithIndex:(int)index;
  
  - (void)print;
  
  @end
  
  //person.m
  @implementation Person
  
  - (instancetype)initWithIndex:(int)index
  {
      if (self = [super init]) {
          _indexStr = [NSString stringWithFormat:@"%d",index];
          NSLog(@"person init index:%d",index);
      }
      return self;
  }
  
  - (void)dealloc
  {
      self.indexStr = nil;
      NSLog(@"person dealloc index:%@",self.indexStr);
      [super dealloc];
  }
  
  @end    
  
  //vc.h
  @property (retain, nonatomic) Person *person;
  
  //vc.m
  - (void)viewDidLoad {
      [super viewDidLoad];
  
      _person = [[Person alloc] initWithIndex:-1];
  
      for (int i = 0; i &lt; 100000; i++) {
          dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
              [self actionWrite:@(i)];
          });
      }
  
      //    [NSThread detachNewThreadSelector:@selector(actionRead) toTarget:self withObject:nil];
  }
  
  - (void)actionWrite:(NSNumber *)num
  {
      @synchronized(self) {
          self.person = [[[Person alloc] initWithIndex:[num intValue]] autorelease];
      }
  }
  </code></pre>
  
  <h1>The code is in MRC.</h1>
  
  <p>It will crash at "actionWrith:" method. The log is:</p>
  
  <pre><code>2014-09-16 10:11:26.452 testThreadNoARC[1777:149948] person init index:357
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149961] person init index:358
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149947] person init index:359
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149937] person init index:360
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149944] person init index:361
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149950] person init index:362
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149941] person init index:363
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149959] person init index:364
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149955] person init index:365
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149951] person init index:366
  2014-09-16 10:11:26.452 testThreadNoARC[1777:149958] person init index:367
  2014-09-16 10:11:26.466 testThreadNoARC[1777:149975] person init index:368
  2014-09-16 10:11:26.466 testThreadNoARC[1777:149964] person init index:369
  2014-09-16 10:11:26.466 testThreadNoARC[1777:149971] person init index:370
  2014-09-16 10:11:26.466 testThreadNoARC[1777:149863] *** -[CFString release]: message sent to deallocated instance 0x7fdc5bec77b0
  </code></pre>
  
  <p>It crashed at thread 1 everytime, I don't know why this will happyen.
  I think the Person object has been released, there maybe release again to make the crash.
  but everytime I run the code, it's crash log is the same.
  The same code run well at ARC.</p>