Commit 4e05fc60 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

interrupt: remove debug flag

parent d6ab70fc
...@@ -43,16 +43,6 @@ ...@@ -43,16 +43,6 @@
#include "interrupt.h" #include "interrupt.h"
#include "libvlc.h" #include "libvlc.h"
#ifndef NDEBUG
static void vlc_interrupt_destructor(void *data)
{
vlc_interrupt_t *ctx = data;
assert(ctx->attached);
ctx->attached = false;
}
#endif
static unsigned vlc_interrupt_refs = 0; static unsigned vlc_interrupt_refs = 0;
static vlc_rwlock_t vlc_interrupt_lock = VLC_STATIC_RWLOCK; static vlc_rwlock_t vlc_interrupt_lock = VLC_STATIC_RWLOCK;
static vlc_threadvar_t vlc_interrupt_var; static vlc_threadvar_t vlc_interrupt_var;
...@@ -65,19 +55,12 @@ void vlc_interrupt_init(vlc_interrupt_t *ctx) ...@@ -65,19 +55,12 @@ void vlc_interrupt_init(vlc_interrupt_t *ctx)
vlc_rwlock_wrlock(&vlc_interrupt_lock); vlc_rwlock_wrlock(&vlc_interrupt_lock);
assert(vlc_interrupt_refs < UINT_MAX); assert(vlc_interrupt_refs < UINT_MAX);
if (vlc_interrupt_refs++ == 0) if (vlc_interrupt_refs++ == 0)
#ifndef NDEBUG
vlc_threadvar_create(&vlc_interrupt_var, vlc_interrupt_destructor);
#else
vlc_threadvar_create(&vlc_interrupt_var, NULL); vlc_threadvar_create(&vlc_interrupt_var, NULL);
#endif
vlc_rwlock_unlock(&vlc_interrupt_lock); vlc_rwlock_unlock(&vlc_interrupt_lock);
vlc_mutex_init(&ctx->lock); vlc_mutex_init(&ctx->lock);
ctx->interrupted = false; ctx->interrupted = false;
atomic_init(&ctx->killed, false); atomic_init(&ctx->killed, false);
#ifndef NDEBUG
ctx->attached = false;
#endif
ctx->callback = NULL; ctx->callback = NULL;
} }
...@@ -96,7 +79,6 @@ vlc_interrupt_t *vlc_interrupt_create(void) ...@@ -96,7 +79,6 @@ vlc_interrupt_t *vlc_interrupt_create(void)
void vlc_interrupt_deinit(vlc_interrupt_t *ctx) void vlc_interrupt_deinit(vlc_interrupt_t *ctx)
{ {
assert(ctx->callback == NULL); assert(ctx->callback == NULL);
assert(!ctx->attached);
vlc_mutex_destroy(&ctx->lock); vlc_mutex_destroy(&ctx->lock);
vlc_rwlock_wrlock(&vlc_interrupt_lock); vlc_rwlock_wrlock(&vlc_interrupt_lock);
...@@ -139,18 +121,6 @@ vlc_interrupt_t *vlc_interrupt_set(vlc_interrupt_t *newctx) ...@@ -139,18 +121,6 @@ vlc_interrupt_t *vlc_interrupt_set(vlc_interrupt_t *newctx)
assert(vlc_interrupt_refs > 0); assert(vlc_interrupt_refs > 0);
oldctx = vlc_threadvar_get(vlc_interrupt_var); oldctx = vlc_threadvar_get(vlc_interrupt_var);
#ifndef NDEBUG
if (oldctx != NULL)
{
assert(oldctx->attached);
oldctx->attached = false;
}
if (newctx != NULL)
{
assert(!newctx->attached);
newctx->attached = true;
}
#endif
vlc_threadvar_set(vlc_interrupt_var, newctx); vlc_threadvar_set(vlc_interrupt_var, newctx);
return oldctx; return oldctx;
......
...@@ -32,9 +32,6 @@ struct vlc_interrupt ...@@ -32,9 +32,6 @@ struct vlc_interrupt
{ {
vlc_mutex_t lock; vlc_mutex_t lock;
bool interrupted; bool interrupted;
#ifndef NDEBUG
bool attached;
#endif
atomic_bool killed; atomic_bool killed;
void (*callback)(void *); void (*callback)(void *);
void *data; void *data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment