pnoltes opened a new pull request, #536: URL: https://github.com/apache/celix/pull/536
This PR introduces a new error message functionality, `celix_err`, built on thread local storage. The purpose of `celix_err` is to propagate error messages from low-level libraries without relying on a logging system. These messages can then be forwarded to a `celix_log_service` or a logging library at the Celix bundle level. The current implementation uses pthread thread-specific data functions and also provides an alternative implementation (controlled by the `CELIX_ERR_USE_THREAD_LOCAL` define) using pthread `__thread` thread local variables. It is still to be determined whether to use thread-specific storage (tss) functions or thread local variables. The thread local variable implementation appears simpler and is likely to be lazily initialized for gcc and clang. If the `celix_err` thread local variable is not initialized lazily, using tss functions would IMO be preferred. Another advantage of using tss functions is that the message buffer can be made dynamic and grow as needed using realloc. This can also be used to minimize the initial size of the thread-specific storage (currently set to 512). Additional changes in this PR include: - Adding celix tss abstraction in celix_threads.h for pthread thread-specific data functions to prevent direct dependency on pthread within Celix code. - Refactoring celix threads cpputest to gtest and adding tests for celix tss. - Extending Celix::threads_ei library with error injection functions for celix tss. Any feedback is welcome. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org