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.comon 17 Apr 2012 at 5:34Attachments: