nghttpx: Use vector for WorkerEvent queue

This commit is contained in:
Tatsuhiro Tsujikawa 2015-06-12 21:28:24 +09:00
parent 532bffdb01
commit 6d5c00b8eb
2 changed files with 2 additions and 3 deletions

View File

@ -119,7 +119,7 @@ void Worker::send(const WorkerEvent &event) {
} }
void Worker::process_events() { void Worker::process_events() {
std::deque<WorkerEvent> q; std::vector<WorkerEvent> q;
{ {
std::lock_guard<std::mutex> g(m_); std::lock_guard<std::mutex> g(m_);
q.swap(q_); q.swap(q_);

View File

@ -28,7 +28,6 @@
#include "shrpx.h" #include "shrpx.h"
#include <mutex> #include <mutex>
#include <deque>
#include <vector> #include <vector>
#include <thread> #include <thread>
#ifndef NOTHREADS #ifndef NOTHREADS
@ -117,7 +116,7 @@ private:
std::future<void> fut_; std::future<void> fut_;
#endif // NOTHREADS #endif // NOTHREADS
std::mutex m_; std::mutex m_;
std::deque<WorkerEvent> q_; std::vector<WorkerEvent> q_;
ev_async w_; ev_async w_;
ev_timer mcpool_clear_timer_; ev_timer mcpool_clear_timer_;
MemchunkPool mcpool_; MemchunkPool mcpool_;