UltraMonkey-L7 V3(multi-thread implementation)
リビジョン | f8d5d203a2b1407f90532675407450e132cc9b33 (tree) |
---|---|
日時 | 2012-08-30 16:57:03 |
作者 | Hiroaki Nakano <nakano.hiroaki@nttc...> |
コミッター | Hiroaki Nakano |
#29144 で無駄にtime waitしていたのを改善
Signed-off-by: Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp>
@@ -901,14 +901,15 @@ void tcp_session::up_thread_run() | ||
901 | 901 | parent_dispatcher.post(boost::bind(&tcp_session::up_thread_client_ssl_socket_clear_socket_handler,this)); |
902 | 902 | boost::mutex::scoped_lock lock(upthread_status_mutex); |
903 | 903 | while (unlikely(upthread_status == UPTHREAD_LOCK)) { |
904 | - to_time(LOCKTIMEOUT, xt); | |
905 | - upthread_status_cond.timed_wait(lock, xt); | |
906 | 904 | tcp_thread_message *msg = up_thread_message_que.pop(); |
907 | 905 | if (msg) { // message is alive. |
908 | 906 | msg->message(MESSAGE_PROC); |
909 | 907 | delete msg; |
910 | 908 | msg = NULL; |
911 | - } | |
909 | + }else{ | |
910 | + to_time(LOCKTIMEOUT, xt); | |
911 | + upthread_status_cond.timed_wait(lock, xt); | |
912 | + } | |
912 | 913 | } // lockmode while loop end. |
913 | 914 | } |
914 | 915 |