• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

UltraMonkey-L7 V3(multi-thread implementation)


Commit MetaInfo

Revision6f2218216860555ecf2243cdc51758a0e9a2f614 (tree)
Time2013-06-13 15:37:58
AuthorHiroaki Nakano <nakano.hiroaki@nttc...>
CommiterHiroaki Nakano

Log Message

Merge branch 'remain_thread_fix' into v3.1.0-devel

Change Summary

Incremental Difference

--- a/l7vsd/include/virtualservice.h
+++ b/l7vsd/include/virtualservice.h
@@ -451,6 +451,8 @@ protected:
451451 session_map_type active_sessions;
452452 l7vs::atomic<unsigned long long>
453453 active_count;
454+ session_thread_control *waiting_stc;
455+ //! session_thread_control waiting accept
454456
455457 bool defer_accept_opt;
456458 //! is set option TCP_DEFER_ACCEPT
--- a/l7vsd/src/virtualservice_tcp.cpp
+++ b/l7vsd/src/virtualservice_tcp.cpp
@@ -432,6 +432,7 @@ void l7vs::virtualservice_tcp::handle_accept(const l7vs::session_thread_control
432432 stc_ptr_noconst->session_access_log_output_mode_change(access_log_flag);
433433
434434 active_sessions.insert(tmp_session, stc_ptr_noconst);
435+ waiting_stc = NULL;
435436
436437 //check sorry flag and status
437438 if (unlikely(
@@ -502,6 +503,7 @@ void l7vs::virtualservice_tcp::handle_accept(const l7vs::session_thread_control
502503 boost::mutex::scoped_lock down_wait_lk(stc_ptr_register_accept->get_downthread_mutex());
503504
504505 waiting_session = stc_ptr_register_accept->get_session().get();
506+ waiting_stc = stc_ptr_register_accept;
505507
506508 if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) {
507509 boost::format fmt1("active session thread id = %d");
@@ -920,7 +922,7 @@ void l7vs::virtualservice_tcp::finalize(l7vs::error_code &err)
920922 delete stc;
921923 stc = NULL;
922924 if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) {
923- boost::format fmt("join pool session: pool_sessions.size = %d");
925+ boost::format fmt("join pool session: pool_session.size = %d");
924926 fmt % pool_sessions.size();
925927 Logger::putLogDebug(LOG_CAT_L7VSD_VIRTUALSERVICE, 55, fmt.str(),
926928 __FILE__, __LINE__);
@@ -930,6 +932,9 @@ void l7vs::virtualservice_tcp::finalize(l7vs::error_code &err)
930932 delete waiting_session;
931933 waiting_session = NULL;
932934
935+ //waiting thread delete
936+ waiting_stc->join();
937+
933938 //unload ProtocolModule
934939 if (protomod) {
935940 //finalize ProtocolModule
@@ -1597,6 +1602,7 @@ void l7vs::virtualservice_tcp::run()
15971602 } while (!stc_ptr);
15981603
15991604 waiting_session = stc_ptr->get_session().get();
1605+ waiting_stc = stc_ptr;
16001606
16011607 if (!ssl_virtualservice_mode_flag) {
16021608 acceptor_->async_accept(waiting_session->get_client_socket().get_socket(),