メソッド本体で @synchronized ディレクティブを使用する
-(void)testSynchronizeMethod:(int)value
{
    @synchronized(value)
    {
        int value1 = 100; //sample line 1
        int value2 = 120; //sample line 2
        [self calledMethod];
    }
}
//case 1
-(void)calledMethod
{
    NSLog(@"is @synchronized directive applied to this method");
    NSLog(@"what happens if I enclose this method with @synchronized directive");
}
**or**
//case 2
-(void)calledMethod
{
    @synchronized(value){
        NSLog(@"is @synchronized directive applied to this method");
        NSLog(@"what happens if I enclose this method with @synchronized directive");
    }
}
Q:ケース 2 の場合、'-(void)calledMethod' の周りに 2 つのミューテックス ロックが作成されていますか?
編集このようなミューテックスロックを使用しているときに、メインスレッドでシグナル SIGINT を取得しています。何がうまくいかないのか誰かが私に提案できるなら、私はスクリーングラブを添付していますか?