title: Using Objective-C block as a @synchronized lock
body: <p>I have a block property defined like this:</p>
  <pre><code>@property (nonatomic, strong) void(^block)(void);
  </code></pre>
  <p>and then I'm trying to use it as a <code>@synchronized</code> lock:</p>
  <pre><code>@synchronized (self.block)
  {
      //doing something
  }
  </code></pre>
  <p>The compiler doesn't like this. It says <code>@synchronized requires an Objective-C object type ('void (^)(void)' invalid)</code></p>
  <p>So I'm cheating the compiler by casting the block to <code>id</code></p>
  <pre><code>@synchronized ((id)self.block)
  {
      //doing something
  }
  </code></pre>
  <p>And it seems to work but I'm not sure if I'm doing a right thing. There may be some caveats I'm not aware of. What do you think about this? Is it even acceptable to use a block like this or is it a bad practice due to some reasons unknown to me?</p>