Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ipaaca
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Social Cognitive Systems
ipaaca
Commits
e3016c4d
Commit
e3016c4d
authored
11 years ago
by
Ramin Yaghoubzadeh Torky
Browse files
Options
Downloads
Patches
Plain Diff
py: added import time
parent
1885b618
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ipaacalib/python/src/ipaaca/__init__.py
+10
-9
10 additions, 9 deletions
ipaacalib/python/src/ipaaca/__init__.py
with
10 additions
and
9 deletions
ipaacalib/python/src/ipaaca/__init__.py
+
10
−
9
View file @
e3016c4d
...
@@ -38,6 +38,7 @@ import threading
...
@@ -38,6 +38,7 @@ import threading
import
uuid
import
uuid
import
collections
import
collections
import
copy
import
copy
import
time
import
rsb
import
rsb
import
rsb.converter
import
rsb.converter
...
@@ -258,15 +259,15 @@ class Payload(dict):
...
@@ -258,15 +259,15 @@ class Payload(dict):
def
_wait_batch_update_lock
(
self
,
timeout
):
def
_wait_batch_update_lock
(
self
,
timeout
):
# wait lock with time-out http://stackoverflow.com/a/8393033
# wait lock with time-out http://stackoverflow.com/a/8393033
with
self
.
_batch_update_cond
:
with
self
.
_batch_update_cond
:
current_time
=
start_time
=
time
.
time
()
current_time
=
start_time
=
time
.
time
()
while
current_time
<
start_time
+
timeout
:
while
current_time
<
start_time
+
timeout
:
if
self
.
_batch_update_lock
.
acquire
(
False
):
if
self
.
_batch_update_lock
.
acquire
(
False
):
return
True
return
True
else
:
else
:
self
.
_batch_update_cond
.
wait
(
timeout
-
current_time
+
start_time
)
self
.
_batch_update_cond
.
wait
(
timeout
-
current_time
+
start_time
)
current_time
=
time
.
time
()
current_time
=
time
.
time
()
raise
IUPayloadLockTimeoutError
(
self
.
iu
)
raise
IUPayloadLockTimeoutError
(
self
.
iu
)
class
IUInterface
(
object
):
#{{{
class
IUInterface
(
object
):
#{{{
...
...
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