unsigned int tpl_log_lvl = 0;
unsigned int tpl_log_initialized = 0;
-unsigned int tpl_dump_lvl;
+unsigned int tpl_dump_lvl = 0;
struct _tpl_runtime {
tpl_hlist_t *displays[TPL_BACKEND_COUNT];
if (runtime != NULL) {
int i;
- for (i = 0; i < TPL_BACKEND_COUNT; i++) {
- if (runtime->displays[i] != NULL)
- __tpl_hashlist_destroy(&(runtime->displays[i]));
+ if (!pthread_mutex_lock(&runtime_mutex)) {
+ for (i = 0; i < TPL_BACKEND_COUNT; i++) {
+ if (runtime->displays[i] != NULL)
+ __tpl_hashlist_destroy(&(runtime->displays[i]));
+ }
+ pthread_mutex_unlock(&runtime_mutex);
}
free(runtime);
int
__tpl_util_clz(int val)
{
- return __builtin_clz( val );
+ return __builtin_clz(val);
}
int
}
unsigned int
-__tpl_util_atomic_inc(tpl_util_atomic_uint *const atom )
+__tpl_util_atomic_inc(tpl_util_atomic_uint *const atom)
{
TPL_ASSERT(atom);
}
unsigned int
-__tpl_util_atomic_dec( tpl_util_atomic_uint *const atom )
+__tpl_util_atomic_dec(tpl_util_atomic_uint *const atom)
{
TPL_ASSERT(atom);