| 25 | } |
| 26 | |
| 27 | ErrorCtx *ErrorCtx_Get(void) { |
| 28 | ErrorCtx *ctx = pthread_getspecific(_tlsErrorCtx); |
| 29 | |
| 30 | if(ctx == NULL) { |
| 31 | ctx = rm_calloc(1, sizeof(ErrorCtx)); |
| 32 | int res = pthread_setspecific(_tlsErrorCtx, ctx); |
| 33 | ASSERT(res == 0); |
| 34 | } |
| 35 | |
| 36 | return ctx; |
| 37 | } |
| 38 | |
| 39 | void ErrorCtx_Clear(void) { |
| 40 | ErrorCtx *ctx = ErrorCtx_Get(); |
no test coverage detected