Exemple #1
0
 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"))
Exemple #2
0
 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"))
Exemple #3
0
 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
Exemple #4
0
 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
Exemple #5
0
 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()
Exemple #7
0
 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(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")
Exemple #9
0
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)
Exemple #10
0
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)
Exemple #11
0
 def __init__(self, space):
     try:
         self.lock = thread.allocate_lock()
     except thread.error:
         raise wrap_thread_error(space, "out of resources")