Created
January 23, 2013 06:51
-
-
Save thomaslee/4602689 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 os; | |
task_b some_func { | |
os.sleep(5); # give task_a time to die. | |
some_func(); | |
} | |
task_a { | |
# | |
# Compile some_module.chimp, return a module object. | |
# | |
# Note this module object is owned by the GC associated with | |
# the task backing task_a. | |
# | |
var mod = compile("some_module.chimp"); | |
spawn task_b(mod.some_method); | |
} | |
main argv { | |
spawn task_a(); | |
# | |
# task_b will wake up ~5 seconds in & try to call | |
# some_func, which has probably been collected. | |
# | |
os.sleep(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment