Skip to content

Commit

Permalink
Add limitations section.
Browse files Browse the repository at this point in the history
  • Loading branch information
askolesov committed Aug 21, 2023
1 parent 684687d commit c77a52d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ tr3 := gosync.GoRes(func() int {
gosync.WaitAny(ts1, ts2, ts3)
```

Limitations
-----------

In Go, there is no direct way to terminate a running goroutine from outside of it. Goroutines can only be terminated from within by returning from the function or using channels to signal termination. As a result:

- Calling `Wait()` on an infinitely running task will block the calling routine indefinitely.
- Calling `WaitTimeout()` or `WaitCtx()` on an infinitely running goroutine will result in a new locked routine being spawned.
- If `WaitTimeout()` or `WaitCtx()` is called and then exited due to timeout or cancellation, the internally spawned routine will continue to stay alive until the task itself is finished.

FAQ (Frequently Asked Questions)
--------------------------------

Expand Down

0 comments on commit c77a52d

Please sign in to comment.