mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
fix compile error for msvc
This commit is contained in:
parent
36d85e4b41
commit
ad01ec62f5
@ -133,20 +133,22 @@ public:
|
||||
using alloc_policy = AllocP;
|
||||
|
||||
private:
|
||||
class alloc_proxy : public alloc_policy {
|
||||
spin_lock master_lock_;
|
||||
std::vector<alloc_policy> master_allocs_;
|
||||
|
||||
class alloc_proxy : public AllocP {
|
||||
async_wrapper * w_ = nullptr;
|
||||
|
||||
public:
|
||||
alloc_proxy(alloc_proxy&& rhs)
|
||||
: alloc_policy(std::move(rhs))
|
||||
: AllocP(std::move(rhs))
|
||||
{}
|
||||
|
||||
alloc_proxy(async_wrapper* w)
|
||||
: alloc_policy(), w_(w) {
|
||||
alloc_proxy(async_wrapper* w) : w_(w) {
|
||||
if (w_ == nullptr) return;
|
||||
IPC_UNUSED_ auto guard = ipc::detail::unique_lock(w_->master_lock_);
|
||||
if (!w_->master_allocs_.empty()) {
|
||||
alloc_policy::swap(w_->master_allocs_.back());
|
||||
AllocP::swap(w_->master_allocs_.back());
|
||||
w_->master_allocs_.pop_back();
|
||||
}
|
||||
}
|
||||
@ -160,9 +162,6 @@ private:
|
||||
|
||||
friend class alloc_proxy;
|
||||
|
||||
spin_lock master_lock_;
|
||||
std::vector<alloc_proxy> master_allocs_;
|
||||
|
||||
auto& get_alloc() {
|
||||
static tls::pointer<alloc_proxy> tls_alc;
|
||||
return *tls_alc.create(this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user