twittner/zeromq-haskell — pull request #21 by joell (2012-09-18 20:09:44+00:00)
Title: Make zmq_device interruptible.

It is sometimes desirable to run a zmq_device call in a thread other
than the main thread (e.g., when more than one zmq_device call must be made). To cleanly unwind the program, the main thread
must tell the device thread to exit, thereby closing its sockets.
Unfortunately, it is not possible to interrupt a "safe" FFI call with an
asynchronous exception. Therefore, we have change the foreign
declaration for zmq_device from "safe" to "interruptible" to enable this type of teardown.