mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
prepare new policies for queue
This commit is contained in:
parent
be15b2377f
commit
7b5ab36fc1
@ -280,8 +280,8 @@ public:
|
|||||||
|
|
||||||
using base_t::cursor;
|
using base_t::cursor;
|
||||||
|
|
||||||
template <typename F>
|
template <typename F, typename... P>
|
||||||
bool push(F&& f) noexcept {
|
bool push(F&& f, P&&...) noexcept {
|
||||||
return base_t::push(this, std::forward<F>(f), block_);
|
return base_t::push(this, std::forward<F>(f), block_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public:
|
|||||||
if (elems_ == nullptr) return false;
|
if (elems_ == nullptr) return false;
|
||||||
if (elems_->push([&](void* p) {
|
if (elems_->push([&](void* p) {
|
||||||
::new (p) T(std::forward<P>(params)...);
|
::new (p) T(std::forward<P>(params)...);
|
||||||
})) {
|
}, std::forward<P>(params)...)) {
|
||||||
waiter_.broadcast();
|
waiter_.broadcast();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user