From d18d90317ac5d303af09e45cd2af63e46687325e Mon Sep 17 00:00:00 2001 From: Ludvig Strigeus Date: Tue, 20 Nov 2018 20:36:25 +0100 Subject: [PATCH] Add comments to MultithreadedDelayedDelete --- tunsafe_threading.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tunsafe_threading.h b/tunsafe_threading.h index 6e27c99..9c2a29b 100644 --- a/tunsafe_threading.h +++ b/tunsafe_threading.h @@ -193,13 +193,19 @@ public: MultithreadedDelayedDelete(); ~MultithreadedDelayedDelete(); + // Call this with the # of worker threads that will call the wireguard code + void Configure(uint32 num_threads); + + // Add something that will be deleted. typedef void DoDeleteFunc(void *x); void Add(DoDeleteFunc *func, void *param); - void Configure(uint32 num_threads); + // Call this periodically from worker thread with id |thread_id|, ids start from zero up to num_threads-1 void Checkpoint(uint32 thread_id); + // Call this periodically from the main thread to do the actual deletes once the worker threads + // have reached the checkpoint. void MainCheckpoint(); bool enabled() const { return num_threads_ != 0; }