File tree 3 files changed +7
-2
lines changed
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
+ v3.9.1 (2023-03-14)
4
+ -------------------
5
+ - Use ``time.perf_counter `` instead of ``time.monotonic `` for calculating timeouts.
6
+
3
7
v3.9.0 (2022-12-28)
4
8
-------------------
5
9
- Move build backend to ``hatchling `` :pr: `185 - by :user:`gaborbernat `.
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ def acquire(
164
164
165
165
lock_id = id (self )
166
166
lock_filename = self ._lock_file
167
- start_time = time .monotonic ()
167
+ start_time = time .perf_counter ()
168
168
try :
169
169
while True :
170
170
with self ._thread_lock :
@@ -178,7 +178,7 @@ def acquire(
178
178
elif blocking is False :
179
179
_LOGGER .debug ("Failed to immediately acquire lock %s on %s" , lock_id , lock_filename )
180
180
raise Timeout (self ._lock_file )
181
- elif 0 <= timeout < time .monotonic () - start_time :
181
+ elif 0 <= timeout < time .perf_counter () - start_time :
182
182
_LOGGER .debug ("Timeout on acquiring lock %s on %s" , lock_id , lock_filename )
183
183
raise Timeout (self ._lock_file )
184
184
else :
Original file line number Diff line number Diff line change 20
20
nblck
21
21
nitpicky
22
22
notset
23
+ perf
23
24
pygments
24
25
rdwr
25
26
ro
You can’t perform that action at this time.
0 commit comments