Skip to content

Commit 8533f46

Browse files
committed
make dict of Threads.Condition
1 parent 6b1fa22 commit 8533f46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/entities/DFGVariable.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ mutable struct VariableNodeData{T<:InferenceVariable}
3232
dontmargin::Bool
3333
solveInProgress::Int
3434
solvedCount::Int
35-
event::Threads.Condition #This object is NOT thread-safe. See Threads.Condition for a thread-safe version. julia 1.2
35+
events::Dict{Symbol,Threads.Condition}
3636
VariableNodeData{T}() where {T <:InferenceVariable} =
37-
new{T}(zeros(1,1), zeros(1,1), Symbol[], Int[], 0, false, :NOTHING, Symbol[], T(), false, 0.0, false, false, 0, 0, Condition())
37+
new{T}(zeros(1,1), zeros(1,1), Symbol[], Int[], 0, false, :NOTHING, Symbol[], T(), false, 0.0, false, false, 0, 0, Dict{Symbol,Threads.Condition}())
3838
VariableNodeData{T}(val::Array{Float64,2},
3939
bw::Array{Float64,2},
4040
BayesNetOutVertIDs::Array{Symbol,1},
@@ -49,11 +49,11 @@ mutable struct VariableNodeData{T<:InferenceVariable}
4949
dontmargin::Bool,
5050
solveInProgress::Int=0,
5151
solvedCount::Int=0,
52-
eventCondition::Condition=Condition()) where T <: InferenceVariable =
52+
events::Dict{Symbol,Threads.Condition}=Dict{Symbol,Threads.Condition}()) where T <: InferenceVariable =
5353
new{T}(val,bw,BayesNetOutVertIDs,dimIDs,dims,
5454
eliminated,BayesNetVertID,separator,
5555
softtype::T,initialized,inferdim,ismargin,
56-
dontmargin, solveInProgress, solvedCount, eventCondition)
56+
dontmargin, solveInProgress, solvedCount, events)
5757
end
5858

5959
##------------------------------------------------------------------------------

0 commit comments

Comments
 (0)