Skip to content

Commit 1d6b04c

Browse files
committed
cleanup
1 parent 7851448 commit 1d6b04c

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/events.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ function timeout(env::Environment, delay::Number=0; priority::Int8=zero(Int8), v
2525
schedule(Timeout(env), delay; priority=priority, value=value)
2626
end
2727

28-
struct Initialize <: AbstractEvent
29-
bev :: BaseEvent
30-
function Initialize(env::Environment)
31-
new(BaseEvent(env))
32-
end
33-
end
34-
35-
struct Interrupt <: AbstractEvent
36-
bev :: BaseEvent
37-
function Interrupt(env::Environment)
38-
new(BaseEvent(env))
39-
end
40-
end
41-
4228
function run(env::Environment, until::Number=typemax(Float64))
4329
run(env, timeout(env, until-now(env)))
4430
end

src/processes.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
struct Initialize <: AbstractEvent
2+
bev :: BaseEvent
3+
function Initialize(env::Environment)
4+
new(BaseEvent(env))
5+
end
6+
end
7+
18
mutable struct Process <: DiscreteProcess
29
bev :: BaseEvent
310
fsmi :: ResumableFunctions.FiniteStateMachineIterator
@@ -35,6 +42,13 @@ function execute(ev::AbstractEvent, proc::Process)
3542
end
3643
end
3744

45+
struct Interrupt <: AbstractEvent
46+
bev :: BaseEvent
47+
function Interrupt(env::Environment)
48+
new(BaseEvent(env))
49+
end
50+
end
51+
3852
function execute_interrupt(ev::Interrupt, proc::Process)
3953
remove_callback(proc.resume, proc.target)
4054
execute(ev, proc)

0 commit comments

Comments
 (0)