Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
43fb703c
Commit
43fb703c
authored
1 year ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
fix pylint issues
parent
8d65dc7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
satella/coding/concurrent/sync.py
+12
-8
12 additions, 8 deletions
satella/coding/concurrent/sync.py
with
12 additions
and
8 deletions
satella/coding/concurrent/sync.py
+
12
−
8
View file @
43fb703c
...
@@ -19,6 +19,17 @@ def _while_sync_threadpool(tpe, max_wait, measurement, futures):
...
@@ -19,6 +19,17 @@ def _while_sync_threadpool(tpe, max_wait, measurement, futures):
time
.
sleep
(
0.5
)
time
.
sleep
(
0.5
)
def
_max_wait_atm_n
(
measurement
,
max_wait
,
atm_n
):
while
measurement
()
<
max_wait
:
try
:
atm_n
.
wait_until_equal
(
0
,
1
)
break
except
WouldWaitMore
:
continue
else
:
raise
WouldWaitMore
(
'
timeout exceeded
'
)
def
sync_threadpool
(
tpe
:
tp
.
Union
[
ExecutorWrapper
,
ThreadPoolExecutor
],
def
sync_threadpool
(
tpe
:
tp
.
Union
[
ExecutorWrapper
,
ThreadPoolExecutor
],
max_wait
:
tp
.
Optional
[
float
]
=
None
)
->
None
:
max_wait
:
tp
.
Optional
[
float
]
=
None
)
->
None
:
"""
"""
...
@@ -54,13 +65,6 @@ def sync_threadpool(tpe: tp.Union[ExecutorWrapper, ThreadPoolExecutor],
...
@@ -54,13 +65,6 @@ def sync_threadpool(tpe: tp.Union[ExecutorWrapper, ThreadPoolExecutor],
if
max_wait
is
None
:
if
max_wait
is
None
:
atm_n
.
wait_until_equal
(
0
)
atm_n
.
wait_until_equal
(
0
)
else
:
else
:
while
measurement
()
<
max_wait
:
_max_wait_atm_n
(
measurement
,
max_wait
,
atm_n
)
try
:
atm_n
.
wait_until_equal
(
0
,
1
)
break
except
WouldWaitMore
:
continue
else
:
raise
WouldWaitMore
(
'
timeout exceeded
'
)
cond
.
notify_all
()
cond
.
notify_all
()
wait
(
futures
)
wait
(
futures
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment