(defvar *log-events-wait-queue* (sb-thread:make-waitqueue :name "log events waitqueue")) (defvar *log-events-mutex* (sb-thread:make-mutex)) (defvar *log-events* nil) (defun my-notify-thread () (with-open-file (stream "mylog.txt" :direction :output :if-exists :append) (format stream "notify thread ~%") ) (sb-thread:with-mutex (*log-events-mutex*) (progn (push 'wara *log-events*) (sb-thread:condition-broadcast *log-events-wait-queue*) ) ) ) (defun my-listen-thread () (sb-thread:with-mutex (*log-events-mutex*) (progn (sb-thread:condition-wait *log-events-wait-queue* *log-events-mutex*) (with-open-file (stream "mylistener.txt" :direction :output :if-exists :append) (format stream "wait thread ~%") ) (format t "my-listen-thread has notified~%") )) (my-listen-thread) )