PengZheng commented on code in PR #536:
URL: https://github.com/apache/celix/pull/536#discussion_r1183410712


##########
libs/utils/src/celix_threads.c:
##########
@@ -236,3 +236,31 @@ celix_status_t 
celixThreadRwlockAttr_destroy(celix_thread_rwlockattr_t *attr) {
 celix_status_t celixThread_once(celix_thread_once_t *once_control, void 
(*init_routine)(void)) {
     return pthread_once(once_control, init_routine);
 }
+
+celix_status_t celix_tss_create(celix_tss_key_t* key, void 
(*destroyFunction)(void*)) {
+    int rc = pthread_key_create(key, destroyFunction);
+    if (rc == 0) {
+        return CELIX_SUCCESS;
+    }
+    return rc == ENOMEM ? CELIX_ENOMEM : CELIX_ILLEGAL_STATE;

Review Comment:
   Our error code scheme already contains all errno. 
   What about we document it explicitly and `return rc` without modifying 
celix_errno.h?



-- 
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

Reply via email to