Skip to content

Commit 73d59ba

Browse files
committed
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.
1 parent 2b1ed4b commit 73d59ba

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/libipc/ipc.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,9 @@ static bool send(F&& gen_push, ipc::handle_t h, void const * data, std::size_t s
588588
}
589589

590590
static bool send(ipc::handle_t h, void const * data, std::size_t size, std::uint64_t tm) {
591-
return send([tm](auto *info, auto *que, auto msg_id) {
592-
return [tm, info, que, msg_id](std::int32_t remain, void const * data, std::size_t size) {
591+
LIBIPC_LOG();
592+
return send([tm, &log](auto *info, auto *que, auto msg_id) {
593+
return [tm, &log, info, que, msg_id](std::int32_t remain, void const * data, std::size_t size) {
593594
if (!wait_for(info->wt_waiter_, [&] {
594595
return !que->push(
595596
[](void*) { return true; },

src/libipc/prod_cons.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ struct prod_cons_impl<wr<relat::multi, relat::multi, trans::broadcast>> {
365365

366366
template <typename W, typename F, typename E>
367367
bool force_push(W* wrapper, F&& f, E* elems) {
368+
LIBIPC_LOG();
368369
E* el;
369370
circ::u2_t cur_ct;
370371
rc_t epoch = epoch_.fetch_add(ep_incr, std::memory_order_release) + ep_incr;

0 commit comments

Comments
 (0)