G
Guest
I have a component (Say Component1 )which has two public functions and one
event(Say Func1 and Func2 and event is MyEvent) This component is being used
by a second component(Say Component2)
Here is the flow of events
1) Component2 intantiates Component1
2) Component2 registers for the event MyEvent
3) Component2 calls function Func1
4) In Func1 of Component1 the event MyEvent is raised. Func1 has to do more
work but event is raised in the middle of Func1.
5) Component2 receives event and calls Func2.
In this test case I just want to know is there a way to detect/prevent
Component2 from calling Func2 until the call to Func1 ends. It is kind of
reentry problem of the Component1. Because the Component1 is not thread safe.
The Func2 changes the state of the Component2. In this case after executing
Func2 the code will fall back to Func1 which will see a changed state.
Is there a way to stop it or making Component2 not to be re-entrant.
Thanks in advance
event(Say Func1 and Func2 and event is MyEvent) This component is being used
by a second component(Say Component2)
Here is the flow of events
1) Component2 intantiates Component1
2) Component2 registers for the event MyEvent
3) Component2 calls function Func1
4) In Func1 of Component1 the event MyEvent is raised. Func1 has to do more
work but event is raised in the middle of Func1.
5) Component2 receives event and calls Func2.
In this test case I just want to know is there a way to detect/prevent
Component2 from calling Func2 until the call to Func1 ends. It is kind of
reentry problem of the Component1. Because the Component1 is not thread safe.
The Func2 changes the state of the Component2. In this case after executing
Func2 the code will fall back to Func1 which will see a changed state.
Is there a way to stop it or making Component2 not to be re-entrant.
Thanks in advance