from __pypy__.thread import atomic
- # Not a STM-enabled PyPy. We can still provide a version of 'atomic'
- # that is good enough for our purposes. With this limited version,
+ # Not a STM-enabled PyPy. We can use a regular lock for 'atomic',
+ # which is good enough for our purposes. With this limited version,
# an atomic block in thread X will not prevent running thread Y, if
# thread Y is not within an atomic block at all.
- _atomic_global_lock = thread.allocate_lock()
- def __exit__(self, *args):
+ atomic = thread.allocate_lock()
from __pypy__.thread import signals_enabled