def __allocate_lock(self): from pypy.module.thread.ll_thread import allocate_lock, error try: return allocate_lock() except error: raise OperationError(self.w_RuntimeError, self.wrap("out of resources"))
def g(): l = allocate_lock() ok1 = l.acquire(True) ok2 = l.acquire(False) l.release() ok3 = l.acquire(False) res = ok1 and not ok2 and ok3 return res
def setup(space): if bootstrapper.lock is None: try: bootstrapper.lock = thread.allocate_lock() except thread.error: raise wrap_thread_error(space, "can't allocate bootstrap lock")
def __init__(self): self.lock = allocate_lock()
def __init__(self, space): self.space = space try: self.lock = thread.allocate_lock() except thread.error: raise wrap_thread_error(space, "out of resources")
def setup_ssl_threads(): from pypy.module.thread import ll_thread for i in range(libssl_CRYPTO_num_locks()): _ssl_locks.append(ll_thread.allocate_lock()) libssl_CRYPTO_set_locking_callback(_ssl_thread_locking_function) libssl_CRYPTO_set_id_callback(_ssl_thread_id_function)
def __init__(self, space): try: self.lock = thread.allocate_lock() except thread.error: raise wrap_thread_error(space, "out of resources")