OSDN Git Service

#29144 で無駄にtime waitしていたのを改善
authorHiroaki Nakano <nakano.hiroaki@nttcom.co.jp>
Thu, 30 Aug 2012 07:57:03 +0000 (16:57 +0900)
committerhibari <l05102@shibaura-it.ac.jp>
Sat, 8 Sep 2012 04:19:30 +0000 (13:19 +0900)
Signed-off-by: Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp>
l7vsd/src/tcp_session.cpp

index 0648253..c0e5a28 100644 (file)
@@ -901,14 +901,15 @@ void tcp_session::up_thread_run()
                 parent_dispatcher.post(boost::bind(&tcp_session::up_thread_client_ssl_socket_clear_socket_handler,this));
                 boost::mutex::scoped_lock lock(upthread_status_mutex);
                 while (unlikely(upthread_status == UPTHREAD_LOCK)) {
-                        to_time(LOCKTIMEOUT, xt);
-                        upthread_status_cond.timed_wait(lock, xt);
                         tcp_thread_message *msg = up_thread_message_que.pop();
                         if (msg) {      // message is alive.
                                 msg->message(MESSAGE_PROC);
                                 delete msg;
                                 msg = NULL;
-                        }
+                        }else{
+                                to_time(LOCKTIMEOUT, xt);
+                                upthread_status_cond.timed_wait(lock, xt);
+                       }
                 }       // lockmode while loop end.
         }