diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-12-15 18:59:00 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-12-15 18:59:00 +1100 |
commit | 281345fdc962398cfdb5a25f2794f0b1c1418728 (patch) | |
tree | 38deede4f1cc257fc10ddcbe033e46e22a66e5f4 /clib/src/err.c | |
parent | 799ef76e460a71ab27280fc7cb7a9e259cef2b7b (diff) | |
download | ffs-281345fdc962398cfdb5a25f2794f0b1c1418728.tar.gz ffs-281345fdc962398cfdb5a25f2794f0b1c1418728.zip |
remove custom assert implementation and exception.c
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'clib/src/err.c')
-rw-r--r-- | clib/src/err.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/clib/src/err.c b/clib/src/err.c index 8312ffd..838c22f 100644 --- a/clib/src/err.c +++ b/clib/src/err.c @@ -44,7 +44,7 @@ #include "err.h" -static pthread_key_t __err_key = 0; +static list_t *__err_key = 0; static const char *__err_type_name[] = { [ERR_NONE] = "none", @@ -68,7 +68,7 @@ void err_delete(err_t * self) err_t *err_get(void) { - list_t *list = (list_t *) pthread_getspecific(__err_key); + list_t *list = __err_key; err_t *self = NULL; @@ -77,7 +77,7 @@ err_t *err_get(void) if (list_empty(list)) { free(list), list = NULL; - assert(pthread_setspecific(__err_key, list) == 0); + __err_key = list; } } @@ -88,13 +88,13 @@ void err_put(err_t * self) { assert(self != NULL); - list_t *list = pthread_getspecific(__err_key); + list_t *list = __err_key; if (list == NULL) { list = (list_t *) malloc(sizeof(*list)); assert(list != NULL); list_init(list); - assert(pthread_setspecific(__err_key, list) == 0); + __err_key = list; } list_add_head(list, &self->node); @@ -207,9 +207,3 @@ const char *err_type_name(err_t * self) return __err_type_name[self->type]; } -/* =======================================================================*/ - -__constructor static void __err__ctor__(void) -{ - assert(pthread_key_create(&__err_key, NULL) == 0); -} |