Skip to content

Commit 1328e0d

Browse files
committed
rename file
1 parent cf20a7f commit 1328e0d

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/12_cocurrent/how_to_create_a_thread_pool/example1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
from concurrent.futures import ThreadPoolExecutor
33

44
def echo_client(sock, client_addr):
5-
'''
6-
Handle a client connection
7-
'''
5+
'''Handle a client connection'''
86
print('Got connection from', client_addr)
97
while True:
108
msg = sock.recv(65536)
@@ -14,6 +12,7 @@ def echo_client(sock, client_addr):
1412
print('Client closed connection')
1513
sock.close()
1614

15+
1716
def echo_server(addr):
1817
print('Echo server running at', addr)
1918
pool = ThreadPoolExecutor(128)
@@ -24,4 +23,5 @@ def echo_server(addr):
2423
client_sock, client_addr = sock.accept()
2524
pool.submit(echo_client, client_sock, client_addr)
2625

27-
echo_server(('',15000))
26+
27+
echo_server(('', 15000))

src/12_cocurrent/how_to_lock_critical_sections/example1.py renamed to src/12_cocurrent/how_to_lock_critical_sections/lock_critical_section.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ def __init__(self, initial_value = 0):
99
self._value_lock = threading.Lock()
1010

1111
def incr(self,delta=1):
12-
'''
13-
Increment the counter with locking
14-
'''
12+
"""Increment the counter with locking"""
1513
with self._value_lock:
1614
self._value += delta
1715

0 commit comments

Comments
 (0)