Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 27, 2023
1 parent 4f9972d commit 7f3610b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ void suspend_parked(struct cluster *c);
/*
* suspend_threads: request to suspend all threads in the cluster.
*
* when suspended, every threads in the cluster will either
* a) block in suspend_threads
* b) rewind the stack (by returning a restartable error) and block
* in suspend_parked.
* when suspend_threads returns, every other threads in the cluster
* are either:
* a) blocking in suspend_threads
* b) or, rewinded the stack (by returning a restartable error) and
* blocking in suspend_parked.
*
* suspend_threads works as a cluster-global mutex as well.
* that is, only one thread can execute the code between suspend_threads
* and resume_threads in the same time.
* among threads calling suspend_threads, suspend_threads works as
* a cluster-global mutex as well. that is, only one thread can execute
* the code between suspend_threads and resume_threads in the same time.
*
* Note: this is a no-op for TOYWASM_USE_USER_SCHED=ON.
*/
Expand Down

0 comments on commit 7f3610b

Please sign in to comment.