summaryrefslogtreecommitdiff
path: root/accel-pptpd/triton
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/triton')
-rw-r--r--accel-pptpd/triton/triton.c15
-rw-r--r--accel-pptpd/triton/triton.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/accel-pptpd/triton/triton.c b/accel-pptpd/triton/triton.c
index b62d04f..a628fe1 100644
--- a/accel-pptpd/triton/triton.c
+++ b/accel-pptpd/triton/triton.c
@@ -416,6 +416,21 @@ int __export triton_context_call(struct triton_context_t *ud, void (*func)(void
return 0;
}
+void __export triton_cancel_call(struct triton_context_t *ud, void (*func)(void *))
+{
+ struct _triton_context_t *ctx = (struct _triton_context_t *)ud->tpd;
+ struct list_head *pos, *n;
+ struct _triton_ctx_call_t *call;
+
+ list_for_each_safe(pos, n, &ctx->pending_calls) {
+ call = list_entry(pos, typeof(*call), entry);
+ if (call->func != func)
+ continue;
+ list_del(&call->entry);
+ mempool_free(call);
+ }
+}
+
int __export triton_init(const char *conf_file)
{
ctx_pool = mempool_create2(sizeof(struct _triton_context_t));
diff --git a/accel-pptpd/triton/triton.h b/accel-pptpd/triton/triton.h
index 9425428..0fd450c 100644
--- a/accel-pptpd/triton/triton.h
+++ b/accel-pptpd/triton/triton.h
@@ -72,6 +72,7 @@ void triton_context_set_priority(struct triton_context_t *, int);
void triton_context_schedule(struct triton_context_t *);
int triton_context_wakeup(struct triton_context_t *);
int triton_context_call(struct triton_context_t *, void (*func)(void *), void *arg);
+void triton_cancel_call(struct triton_context_t *, void (*func)(void *));
#define MD_MODE_READ 1
#define MD_MODE_WRITE 2