Skip to content

Patch: Add Thread Enter/Exit Events #345

Description

@GoogleCodeExporter
To make it easier to do database connection pooling in my app, I've created 
this patch to expand the callback functions so that they provide calls when 
each worker thread starts and stops. This should not cause any added overhead 
since the number of worker threads is static.

The comments in the mongoose.h should be self-explanatory.

Events added: MG_ENTER_THREAD, MG_EXIT_THREAD (These events receive unusual 2nd 
and 3rd parameters. Since there is no socket connection when they are called, 
the 2nd parameter is replaced by the void *user_data originally passed to 
mg_start().)

Structures modified: mg_request_info -> added void* thread_ctx

Functions modified: worker_thread()

Tested only on Windows, with Visual Studio 6.

Original issue reported on code.google.com by jmucchie...@gmail.com on 17 Apr 2012 at 5:34

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions