thread: Fix comments

Fixes #1121
This commit is contained in:
Hajime Hoshi 2020-03-29 16:27:08 +09:00
parent 41d07706ae
commit 9a14d2fb14

View File

@ -37,6 +37,8 @@ func New() *Thread {
// Loop starts the thread loop. // Loop starts the thread loop.
// //
// Loop must be called on the thread. // Loop must be called on the thread.
//
// Loop can be called multiple times.
func (t *Thread) Loop(context context.Context) { func (t *Thread) Loop(context context.Context) {
loop: loop:
for { for {
@ -53,7 +55,7 @@ loop:
// //
// Do not call this from the same thread. This would block forever. // Do not call this from the same thread. This would block forever.
// //
// Call panics when Loop already ends. // Call blocks if Loop is not called.
func (t *Thread) Call(f func() error) error { func (t *Thread) Call(f func() error) error {
t.funcs <- f t.funcs <- f
return <-t.results return <-t.results