mozilla-servo/glfw-rs — pull request #2 by larsbergstrom (2013-08-27 22:56:36+00:00)
Title: This change to use message passing addresses issue #23.

Related to issue #23, we remove the use of task local storage and instead track all
registered event handlers within the Window struct itself. We also use a channel
for the callbacks from the C code, which requires some changes to the
way that clients poll for events.

This change fixes a crash at shutdown in Servo (and any other application that captures an @mut inside of a closure and registers it with an event handler via glfw-rs today).

In addition to everything you see, I'd really like your opinion on:
1) Similar to Jack's "glfw-refactor," this change requires that clients all call poll_events on the Window. Should that just internally call the global one? Or is there a design with a background per-window task that spins and polls that you would prefer?
2) The move of the WindowData into the Window class broke its #deriving[Eq, IterBytes]. Is this going to cause problems with some client scenarios?