Replace RLock by Semaphore
This commit is contained in:
parent
4b9d3501a1
commit
414173c0eb
|
@ -4,8 +4,7 @@
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from random import randint, uniform
|
from random import randint, uniform
|
||||||
from typing import Any, Tuple, Generator
|
from typing import Any, Tuple, Generator
|
||||||
# from ipaddress import IPv6Address
|
from threading import Thread, Semaphore
|
||||||
from threading import Thread, RLock
|
|
||||||
import curses
|
import curses
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
|
@ -116,9 +115,9 @@ class User(Peer):
|
||||||
self.last_line = -1
|
self.last_line = -1
|
||||||
|
|
||||||
# Lock the refresh function in order to avoid concurrent refresh
|
# Lock the refresh function in order to avoid concurrent refresh
|
||||||
self.refresh_lock = RLock()
|
self.refresh_lock = Semaphore()
|
||||||
# Lock functions that can be used by two threads to avoid concurrent writing
|
# Lock functions that can be used by two threads to avoid concurrent writing
|
||||||
self.data_lock = RLock()
|
self.data_lock = Semaphore()
|
||||||
|
|
||||||
self.history = []
|
self.history = []
|
||||||
self.received_messages = dict()
|
self.received_messages = dict()
|
||||||
|
|
Loading…
Reference in New Issue