mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-01-01 03:12:13 +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) {
|
||||
return send([tm](auto *info, auto *que, auto msg_id) {
|
||||
return [tm, info, que, msg_id](std::int32_t remain, void const * data, std::size_t size) {
|
||||
LIBIPC_LOG();
|
||||
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_, [&] {
|
||||
return !que->push(
|
||||
[](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>
|
||||
bool force_push(W* wrapper, F&& f, E* elems) {
|
||||
LIBIPC_LOG();
|
||||
E* el;
|
||||
circ::u2_t cur_ct;
|
||||
rc_t epoch = epoch_.fetch_add(ep_incr, std::memory_order_release) + ep_incr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user