Commit 73856e97 authored by jan.koester's avatar jan.koester
Browse files

test

parent 9a839a69
Loading
Loading
Loading
Loading
+17 −0
Changes for src/event/kqueue.cpp: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -466,6 +466,23 @@ namespace netplus {
        //dummy
    };
    
    void* worker_wrapper(void* data) {
        ThreadHelperArgs* helper_args = reinterpret_cast<ThreadHelperArgs*>(data);

        try {
            // Call the original worker function
            EventWorker(helper_args->tid, helper_args->args, helper_args->eargs);
        } catch (NetException& e) {
            std::cerr << "Thread " << helper_args->tid << " exited with exception: " << e.what() << std::endl;
        } catch (...) {
            std::cerr << "Thread " << helper_args->tid << " exited with unknown exception." << std::endl;
        }

        // Clean up allocated memory
        delete helper_args;
        return nullptr;
    }

    struct ThreadHelperArgs {
        EventWorkerArgs* eargs;
        ULONG_PTR args;