Hi David and Philipp,
Thanks for the example. This example works for me.
As David mention that newer notification will simply overwrite previous notification even though time delta for newer is larger than previous notification. This is fine in my case as in my case the time delta is always zero. As long as event can be delivered i am fine.
To understand what is meant by shared data, let me elaborate my scenario.
The shared data structure in my case is a queue<int>.
My external thread looks as following
push a value in queue.
thread_safe_event.notify(); // from David's example
wait( thread_safe_event.default_event() );
pop all values from queue.
process values poped from queue.
Does this cover shared data structure protection for my case or do i need add mutexing within thread_safe_event as well? I am asking the question because in David's example m_delay variable essentially a shared variable between external thread and systemC kernel. external thread writes to variable and systemC kernel reads the variable?