30a31,32
> #include "systemc/core/process.hh"
> #include "systemc/ext/core/sc_event.hh"
31a34
> #include "systemc/ext/core/sc_module.hh"
36,39c39
< sc_join::sc_join()
< {
< warn("%s not implemented.\n", __PRETTY_FUNCTION__);
< }
---
> sc_join::sc_join() : remaining(0) {}
42c42
< sc_join::add_process(sc_process_handle)
---
> sc_join::add_process(sc_process_handle h)
44,45c44,45
< warn("%s not implemented.\n", __PRETTY_FUNCTION__);
< }
---
> auto p = (::sc_gem5::Process *)h;
> assert(p);
47,51c47,48
< int
< sc_join::process_count()
< {
< warn("%s not implemented.\n", __PRETTY_FUNCTION__);
< return 0;
---
> remaining++;
> p->joinWait(this);
54,58c51,54
< void
< sc_join::signal(sc_thread_handle thread_p, int type)
< {
< warn("%s not implemented.\n", __PRETTY_FUNCTION__);
< }
---
> int sc_join::process_count() { return remaining; }
> void sc_join::signal() { if (!--remaining) joinEvent.notify(); }
> void sc_join::wait() { ::sc_core::wait(joinEvent); }
> void sc_join::wait_clocked() { do { ::sc_core::wait(); } while (remaining); }
60,71d55
< void
< sc_join::wait()
< {
< warn("%s not implemented.\n", __PRETTY_FUNCTION__);
< }
<
< void
< sc_join::wait_clocked()
< {
< warn("%s not implemented.\n", __PRETTY_FUNCTION__);
< }
<