mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-02-08 02:36:41 +08:00
fix(log): add missing LIBIPC_LOG() and fix lambda log capture
- src/libipc/prod_cons.h: * Add LIBIPC_LOG() to second force_push() template function * This was missing, causing 'log' to be undeclared at line 379 - src/libipc/ipc.cpp: * Add LIBIPC_LOG() to static send() function (line 590) * Capture log by reference in outer lambda: [tm, &log] * Capture log by reference in inner lambda: [tm, &log, info, que, msg_id] * This fixes 'log' was not declared error in lambda at line 598 * The log variable is now properly captured from the outer send() scope These fixes ensure that all functions using log.debug/error/warning have proper LIBIPC_LOG() initialization and lambda captures.
This commit is contained in:
parent
2b1ed4bc51
commit
73d59ba20e
@ -588,8 +588,9 @@ static bool send(F&& gen_push, ipc::handle_t h, void const * data, std::size_t s
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool send(ipc::handle_t h, void const * data, std::size_t size, std::uint64_t tm) {
|
static bool send(ipc::handle_t h, void const * data, std::size_t size, std::uint64_t tm) {
|
||||||
return send([tm](auto *info, auto *que, auto msg_id) {
|
LIBIPC_LOG();
|
||||||
return [tm, info, que, msg_id](std::int32_t remain, void const * data, std::size_t size) {
|
return send([tm, &log](auto *info, auto *que, auto msg_id) {
|
||||||
|
return [tm, &log, info, que, msg_id](std::int32_t remain, void const * data, std::size_t size) {
|
||||||
if (!wait_for(info->wt_waiter_, [&] {
|
if (!wait_for(info->wt_waiter_, [&] {
|
||||||
return !que->push(
|
return !que->push(
|
||||||
[](void*) { return true; },
|
[](void*) { return true; },
|
||||||
|
|||||||
@ -365,6 +365,7 @@ struct prod_cons_impl<wr<relat::multi, relat::multi, trans::broadcast>> {
|
|||||||
|
|
||||||
template <typename W, typename F, typename E>
|
template <typename W, typename F, typename E>
|
||||||
bool force_push(W* wrapper, F&& f, E* elems) {
|
bool force_push(W* wrapper, F&& f, E* elems) {
|
||||||
|
LIBIPC_LOG();
|
||||||
E* el;
|
E* el;
|
||||||
circ::u2_t cur_ct;
|
circ::u2_t cur_ct;
|
||||||
rc_t epoch = epoch_.fetch_add(ep_incr, std::memory_order_release) + ep_incr;
|
rc_t epoch = epoch_.fetch_add(ep_incr, std::memory_order_release) + ep_incr;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user