Is `with` statement __enter__ and __exit__ thread safe?
<p>Suppose:</p>

<pre><code>class A(object):
  def __init__(self):
    self.cnt = 0
  def __enter__(self):
    self.cnt += 1
  def __exit__(self, exc_type, exc_value, traceback)
    self.cnt -= 1
</code></pre>

<ol>
<li>Is it possible that <code>self.cnt += 1</code> might be executed twice when multi-threading?</li>
<li>Is it possible that for the same context manager instance, in multithreading, somehow <code>__enter__</code> be called twice and <code>__exit__</code> be called only once, so the <code>self.cnt</code> final result is <code>1</code>?</li>
</ol>