diff options
Diffstat (limited to 'src/itc.c')
-rw-r--r-- | src/itc.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -87,6 +87,20 @@ int itc_inject(itc *ctx, int timeout_ms, void *element) return 0; } +void itc_flush(itc *ctx) +{ + int i; + + if (ctx == NULL) { + return; + } + + for (i = 0; i < ctx->nslots; i++) { + sem_wait(&ctx->emptied); + sem_post(&ctx->emptied); + } +} + void itc_drop(itc *ctx, itc_free_element free_element) { void *element; |