- [X] Commit message has the format required by CONTRIBUTING guide - [X] Commits are split per component (core, individual modules, libs, utils, ...) - [X] Each component has a single commit (if not, squash them into one commit) - [X] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [X] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [ ] PR should be backported to stable branches - [X] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description Introduce utility functions that run module functions in a thread —- primary use case is to init libssl in a thread. Also to avoid a lot of duplicate pthread_XXXX code.
Does not affect core as it is just a header file, however it could be put into core or a utility object.
This infra is applied to a few modules to see the code savings.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3736
-- Commit Summary --
* core: add infrastructure to run functions in threads * db_unixodbc: use core/rthreads.h * db_mysql: use core/rthreads.h * db_postgres: use core/rthreads.h * outbound: use core/rthreads.h
-- File Changes --
A src/core/rthreads.h (77) M src/modules/db_mysql/km_dbase.c (10) M src/modules/db_postgres/km_dbase.c (32) M src/modules/db_unixodbc/dbase.c (11) M src/modules/outbound/outbound_mod.c (13)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3736.patch https://github.com/kamailio/kamailio/pull/3736.diff
@space88man pushed 5 commits.
83e72f5f093a27266157c8de79a088b6e1d371a9 core: add infrastructure to run functions in threads db4ffc31640694a7ab1da6f426a4451d9f603b14 db_unixodbc: use core/rthreads.h d608beabe6345a935c1bec43aa9421bcbb35bf01 db_mysql: use core/rthreads.h 0d2a03bf6ad7d5b3914e60cdabdcc43f77bd0fd7 db_postgres: use core/rthreads.h d948945fa508b66e9931f2368916ab975b68f2b6 outbound: use core/rthreads.h
Thanks for the PR. I just had a quick look, please add a licence header to the new core file (BSD, similar to other core parts).
Closed #3736.