Skip to content

Commit ebbbf2b

Browse files
committed
update mutex
1 parent d937729 commit ebbbf2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import json
22
from threading import Lock
33

4-
mutex = Lock()
4+
read_writemutex = Lock()
55

66
def readjson(path):
7-
with mutex:
7+
with read_writemutex:
88
f = open("./data/" + path + ".json", 'r')
99
data = json.load(f)
1010
f.close()
1111
return data
1212

1313
def writejson(data, path):
14-
with mutex:
14+
with read_writemutex:
1515
f = open("./data/" + path + ".json", 'w')
1616
json.dump(data, f)
1717
f.close()

0 commit comments

Comments
 (0)