Created
December 14, 2009 08:50
-
-
Save jmblog/255912 to your computer and use it in GitHub Desktop.
超シンプルなCoroのサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Coro; | |
### To create a thread, use the async function | |
async { | |
print "async 1\n"; | |
cede; | |
print "async 2\n"; | |
}; | |
print "main 1\n"; | |
cede; | |
print "main 2\n"; | |
cede; | |
=cmnt | |
main 1 | |
async 1 | |
main 2 | |
async 2 | |
=cut |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment