diff --git a/testpp/main.cpp b/testpp/main.cpp index be99e63..f0b987a 100644 --- a/testpp/main.cpp +++ b/testpp/main.cpp @@ -77,7 +77,7 @@ int main (void) assert (s == std::string("module_b startup end.")); } { - mod_c_extern-> req_startup (); + mod_c_extern-> req_startup_sync (); threadmgr::CSource& r = p_mgr->get_external_if()-> receive_external(); assert (r.get_result() == threadmgr::result::success); std::string s = reinterpret_cast(r.get_message().data()); diff --git a/testpp/module_a/module_a.h b/testpp/module_a/module_a.h index 59a41c3..32f4011 100644 --- a/testpp/module_a/module_a.h +++ b/testpp/module_a/module_a.h @@ -64,6 +64,9 @@ class module_a : public threadmgr::CThreadMgrBase section_id = p_if->get_section_id(); THM_LOG_I ("%s section_id %d\n", __PRETTY_FUNCTION__, section_id); + assert(std::string(p_if->get_sequence_name()) == std::string("startup")); + assert(p_if->get_sequence_idx() == 0); + const char *msg = "module_a startup end."; p_if->reply (threadmgr::result::success, reinterpret_cast(const_cast(msg)), strlen(msg)+1); @@ -85,6 +88,9 @@ class module_a : public threadmgr::CThreadMgrBase section_id = p_if->get_section_id(); THM_LOG_I ("%s section_id %d\n", __PRETTY_FUNCTION__, section_id); + assert(std::string(p_if->get_sequence_name()) == std::string("test_reqrep")); + assert(p_if->get_sequence_idx() == 1); + switch (section_id) { case SECTID_ENTRY: section_id = SECTID_REQ_TEST_REQREPNOTIFY; @@ -153,6 +159,9 @@ class module_a : public threadmgr::CThreadMgrBase section_id = p_if->get_section_id(); THM_LOG_I ("%s section_id %d\n", __PRETTY_FUNCTION__, section_id); + assert(std::string(p_if->get_sequence_name()) == std::string("test_reqrep_notify")); + assert(p_if->get_sequence_idx() == 2); + switch (section_id) { case SECTID_ENTRY: @@ -405,6 +414,9 @@ class module_a : public threadmgr::CThreadMgrBase section_id = p_if->get_section_id(); THM_LOG_I ("%s section_id %d\n", __PRETTY_FUNCTION__, section_id); + assert(std::string(p_if->get_sequence_name()) == std::string("test_lock")); + assert(p_if->get_sequence_idx() == 3); + switch (section_id) { case SECTID_ENTRY: { @@ -471,6 +483,9 @@ class module_a : public threadmgr::CThreadMgrBase section_id = p_if->get_section_id(); THM_LOG_I ("%s section_id %d\n", __PRETTY_FUNCTION__, section_id); + assert(std::string(p_if->get_sequence_name()) == std::string("test_lock_intr")); + assert(p_if->get_sequence_idx() == 4); + m_lock_check << "intr."; p_if->reply (threadmgr::result::success, reinterpret_cast(const_cast(m_lock_check.str().c_str())), m_lock_check.str().length()); @@ -493,6 +508,9 @@ class module_a : public threadmgr::CThreadMgrBase section_id = p_if->get_section_id(); THM_LOG_I ("%s section_id %d\n", __PRETTY_FUNCTION__, section_id); + assert(std::string(p_if->get_sequence_name()) == std::string("test_overwrite")); + assert(p_if->get_sequence_idx() == 5); + switch (section_id) { case SECTID_ENTRY: { @@ -567,6 +585,8 @@ class module_a : public threadmgr::CThreadMgrBase section_id = p_if->get_section_id(); THM_LOG_I ("%s section_id %d\n", __PRETTY_FUNCTION__, section_id); + assert(std::string(p_if->get_sequence_name()) == std::string("test_destroy")); + assert(p_if->get_sequence_idx() == 6); // dump // kill (getpid(), SIGQUIT); diff --git a/testpp/module_c/module_c_extern.h b/testpp/module_c/module_c_extern.h index 2c69b15..d9c8cdf 100644 --- a/testpp/module_c/module_c_extern.h +++ b/testpp/module_c/module_c_extern.h @@ -42,9 +42,9 @@ class module_c_extern : public threadmgr::CThreadMgrExternalIf }; - bool req_startup (void) { + bool req_startup_sync (void) { int sequence = static_cast(sequence::startup); - return request_async (m_module_id, sequence); + return request_sync (m_module_id, sequence); }; bool req_test_reg_notify (void) {