daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func(p *Proc) Doer(){
  2.     p.AsyncWaitForEnd()
  3.     for{
  4.         // do some stuff
  5.     }
  6. }
  7. func(p *Proc) AsyncWaitForEnd(){
  8.     go func() {
  9.         <-p.channel
  10.         // terminate Doer
  11.     }()
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top