コード例 #1
0
ファイル: example3.py プロジェクト: pyarnold/python-cookbook
def philosopher(left, right):
    while True:
        with acquire(left, right):
            print(threading.currentThread(), 'eating')
コード例 #2
0
def thread_2():
    while True:
        with acquire(y_lock):
            with acquire(x_lock):
                print("Wątek-2")
                time.sleep(1)
コード例 #3
0
ファイル: example2.py プロジェクト: pyarnold/python-cookbook
def thread_1():
    while True:
        with acquire(x_lock):
            with acquire(y_lock):
                print("Thread-1")
                time.sleep(1)
コード例 #4
0
def thread_2():
    while True:
        with acquire(y_lock, x_lock):
            print('Trhead-2')
コード例 #5
0
def thread_1():
    while True:
        with acquire(x_lock, y_lock):
            print('Thread-1')
コード例 #6
0
ファイル: example2.py プロジェクト: xuyuchends1/python
def thread_1():
    while True:
        with acquire(x_lock):
            with acquire(y_lock):
                print("Thread-1")
                time.sleep(1)
コード例 #7
0
ファイル: example1.py プロジェクト: isaacl/python-cookbook
def thread_2():
    while True:
        with acquire(y_lock, x_lock):
            print("Thread-2")
            time.sleep(1)
コード例 #8
0
ファイル: example3.py プロジェクト: xuyuchends1/python
def philosopher(left, right):
    while True:
        with acquire(left, right):
            print(threading.currentThread(), 'eating')
コード例 #9
0
ファイル: example1.py プロジェクト: DreamYa0/PythonProject
def thread_1():
    while True:
        with acquire(x_lock, y_lock):
            print("Thread-01")
コード例 #10
0
def thread_2():
    while True:
        with acquire(y_lock, x_lock):
            print("Thread-2")
コード例 #11
0
def thread_1():
    while True:
        with acquire(x_lock, y_lock):
            print("Wątek-1")
コード例 #12
0
def thread_2():
    while True:
        with acquire(y_lock, x_lock):
            print("Wątek-2")