JuliaLang/julia — pull request #3084 by rsofaer (2013-05-11 21:57:52+00:00)
Title: RFC: uv_shutdown in julia close

This pull request resolves issue #2443.

I create a function is_open so that I can find out whether a stream has been marked closed in Julia from the C side, and call it in jl_close_uv to make sure shutdown isn't called twice.

If shutdown is called twice, my test will hang rather than fail. I couldn't figure out how to make that happen well.

I also didn't condense the switch statement in init.c, since I'm not sure whether those separations are still meaningful.

Thanks @vtjnash for helping me a lot with the Julia internals.