bjz/glfw-rs — pull request #126 by csherratt (2014-03-31 18:25:12+00:00)
Title: Added render context for multi-threaded renders.

This adds the trait `Context` which can be used for rendering. There are two implementers of `Context` -- `Window` and `RenderContext`. A render context is made from a `Window` and allows for thread safe sharing of the `Window` between tasks.

The only ugly bit was dealing with dropping a `Window` that has an outstanding `RenderContext`. An internal channel is used in this case, the channel can only be fired when the `RenderContext` is dropped. If the user does not cleanup the the render task correctly it will cause the main thread to block waiting for a response after sending a warning message telling them they probably have a bug.