Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
7410134f
Commit
7410134f
authored
Apr 14, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interruptVictim interrupts victim while processing, otherwise signals it
parent
fe8e5077
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
dream/simulation/ObjectInterruption.py
dream/simulation/ObjectInterruption.py
+2
-14
No files found.
dream/simulation/ObjectInterruption.py
View file @
7410134f
...
...
@@ -40,7 +40,7 @@ class ObjectInterruption(Process):
self
.
call
=
False
def
initialize
(
self
):
Process
.
__init__
(
self
)
#
Process.__init__(self)
self
.
call
=
False
#===========================================================================
...
...
@@ -100,18 +100,10 @@ class ObjectInterruption(Process):
#===========================================================================
def
interruptVictim
(
self
):
# if the victim is not in position to dispose an entity, then interrupt the processing
if
not
self
.
victim
.
waitToDispose
:
#===================================================================
# testing
print
now
(),
self
.
name
,
'interrupts'
,
self
.
victim
.
id
,
'while processing'
#===================================================================
if
not
self
.
victim
.
waitToDispose
and
self
.
victim
.
getActiveObjectQueue
():
self
.
interrupt
(
self
.
victim
)
# otherwise it waits for an interruption event
else
:
#===================================================================
# testing
print
now
(),
self
.
name
,
'interrupts'
,
self
.
victim
.
id
,
'while waiting'
#===================================================================
self
.
victim
.
interruptionStart
.
signal
(
now
())
#===========================================================================
...
...
@@ -119,10 +111,6 @@ class ObjectInterruption(Process):
#===========================================================================
def
reactivateVictim
(
self
):
self
.
victim
.
interruptionEnd
.
signal
(
self
.
victim
)
#===================================================================
# testing
print
now
(),
self
.
name
,
'reactivates'
,
self
.
victim
.
id
#===================================================================
# reactivate(self.victim)
#===========================================================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment