Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit bc292fc

Browse files
Tianyi Chenapavlo
authored andcommitted
further formatting
1 parent 31a8a25 commit bc292fc

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

src/include/common/thread_pool.h

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,29 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
1413
#pragma once
1514

16-
#include <vector>
1715
#include <thread>
16+
#include <vector>
1817

1918
#include <boost/asio/io_service.hpp>
20-
#include <boost/thread/thread.hpp>
2119
#include <boost/bind.hpp>
2220
#include <boost/function.hpp>
21+
#include <boost/thread/thread.hpp>
2322

2423
#include "common/macros.h"
2524

2625
namespace peloton {
2726
// a wrapper for boost worker thread pool.
2827
class ThreadPool {
29-
3028
public:
31-
ThreadPool() : pool_size_(0),
32-
dedicated_thread_count_(0),
33-
work_(io_service_) { }
29+
ThreadPool()
30+
: pool_size_(0), dedicated_thread_count_(0), work_(io_service_) {}
3431

35-
~ThreadPool() { }
32+
~ThreadPool() {}
3633

37-
void Initialize(const size_t &pool_size, const size_t &dedicated_thread_count) {
34+
void Initialize(const size_t &pool_size,
35+
const size_t &dedicated_thread_count) {
3836
current_thread_count_ = ATOMIC_VAR_INIT(0);
3937
pool_size_ = pool_size;
4038
// PL_ASSERT(pool_size_ != 0);
@@ -74,11 +72,10 @@ class ThreadPool {
7472
size_t thread_id =
7573
current_thread_count_.fetch_add(1, std::memory_order_relaxed);
7674
// assign task to dedicated thread.
77-
dedicated_threads_[thread_id].reset(new std::thread(std::thread(func, params...)));
75+
dedicated_threads_[thread_id].reset(
76+
new std::thread(std::thread(func, params...)));
7877
}
7978

80-
81-
8279
private:
8380
ThreadPool(const ThreadPool &);
8481
ThreadPool &operator=(const ThreadPool &);

src/include/network/error_util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
#pragma once
1414

1515
#include <string>
16-
#include <utility>
1716
#include <unordered_map>
17+
#include <utility>
1818

1919
#include <event2/buffer.h>
2020
#include <event2/bufferevent.h>
2121
#include <event2/event.h>
2222
#include <event2/listener.h>
2323

24-
#include "common/logger.h"
2524
#include "common/exception.h"
25+
#include "common/logger.h"
2626

2727
namespace peloton {
2828
namespace network {
@@ -86,5 +86,5 @@ class EventUtil {
8686
"Error in event base dispatch");
8787
}
8888
};
89-
}
90-
}
89+
} // namespace network
90+
} // namespace peloton

0 commit comments

Comments
 (0)