summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r--runtime/web_worker.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 975028b16..07f6facc5 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -206,9 +206,9 @@ impl WebWorkerHandle {
/// Terminate the worker
/// This function will set terminated to true, terminate the isolate and close the message channel
pub fn terminate(self) {
- // This function can be called multiple times by whomever holds
- // the handle. However only a single "termination" should occur so
- // we need a guard here.
+ // A WebWorkerHandle can be terminated / dropped after `self.close()` has
+ // been called inside the worker, but only a single "termination" can occur,
+ // so we need a guard here.
let already_terminated = self.terminated.swap(true, Ordering::SeqCst);
if !already_terminated {