Last active
October 8, 2016 12:29
-
-
Save deadtrickster/15d95400dbf83e7582627e97a22a43e3 to your computer and use it in GitHub Desktop.
io-loop.lisp
This file contains 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
(let* ((mailbox (sb-concurrency:make-mailbox)) | |
(event-base (make-instance 'iolib:event-base)) | |
(control-fd (eventfd:eventfd.new 0)) | |
(thread (bt:make-thread (lambda () | |
(iolib:set-io-handler event-base | |
control-fd | |
:read (lambda (fd e ex) | |
(declare (ignorable fd e ex)) | |
(log:debug (eventfd.read control-fd)))) | |
(loop (iolib:event-dispatch event-base :one-shot t)))))) | |
(eventfd:eventfd.notify-1 control-fd) | |
(sb-concurrency:receive-message mailbox :timeout 3) | |
(print "qwe")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment