# HG changeset patch # User Steve Losh # Date 1482779714 18000 # Node ID ce11a64d569c874cdbf3a95cb7288b4e49636265 # Parent 103e7794c04a09ed4a8d5ef82230ce9c295f1ea4 Start timer thread diff -r 103e7794c04a -r ce11a64d569c content/blog/2016/12/chip8-sound.markdown --- a/content/blog/2016/12/chip8-sound.markdown Mon Dec 26 12:57:52 2016 -0500 +++ b/content/blog/2016/12/chip8-sound.markdown Mon Dec 26 14:15:14 2016 -0500 @@ -155,6 +155,18 @@ We could have used a lock from bordeaux threads to manage this portably (though more slowly), but I wanted to play around with SBCL's concurrency stuff. +Finally we just need to start up the timer thread: + +```lisp +(defun run (rom-filename) + (let ((chip (make-chip))) + (setf *c* chip) + (load-rom chip rom-filename) + (bt:make-thread (curry #'run-cpu chip)) + (bt:make-thread (curry #'run-timers chip)) ; NEW + (chip8.gui.screen::run-gui chip))) +``` + [SBCL manual]: http://www.sbcl.org/manual/#Atomic-Operations ## Sound From Scratch