From ea08dee6b36ef79895c9b92261b4e8a07dc25a82 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Mon, 31 Dec 2007 04:19:13 +0100 Subject: [PATCH] Remove code about running timers in a separate thread. Signed-off-by: Stelian Ionescu --- io-multiplex/scheduler.lisp | 7 +------ io-multiplex/timers.lisp | 15 ++++++--------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/io-multiplex/scheduler.lisp b/io-multiplex/scheduler.lisp index 624e733..5833dca 100644 --- a/io-multiplex/scheduler.lisp +++ b/io-multiplex/scheduler.lisp @@ -62,12 +62,7 @@ ;;; (defun dispatch-timer (timer) - (symbol-macrolet ((function (%timer-function timer)) - (relative-time (%timer-relative-time timer)) - (new-thread-p (%timer-new-thread-p timer))) - (if new-thread-p - (bt:make-thread function :name "Auxiliary timer thread.") - (funcall function)))) + (funcall (%timer-function timer))) (defun timer-reschedulable-p (timer) (symbol-macrolet ((relative-time (%timer-relative-time timer)) diff --git a/io-multiplex/timers.lisp b/io-multiplex/timers.lisp index 5f74621..12a52ac 100644 --- a/io-multiplex/timers.lisp +++ b/io-multiplex/timers.lisp @@ -32,7 +32,7 @@ (defstruct (timer (:conc-name %timer-) (:constructor %make-timer (name function expire-time - relative-time one-shot new-thread-p))) + relative-time one-shot))) name ;; to call when the timer expires function @@ -42,22 +42,19 @@ relative-time ;; when NIL, the timer is automatically rescheduled ;; when triggered - one-shot - ;; when not NIL, call FUNCTION in a new thread - new-thread-p) + one-shot) (defmethod print-object ((object timer) stream) (print-unreadable-object (object stream) - (format stream "TIMER ~S, Timeout: [ ~A , ~A ], ~:[persistent~;one-shot~], to run in ~:[same~;new~] thread" + (format stream "TIMER ~S, Timeout: [ ~A , ~A ], ~:[persistent~;one-shot~]" (or (%timer-name object) "(unnamed)") (%timer-relative-time object) (%timer-expire-time object) - (%timer-one-shot object) - (%timer-new-thread-p object)))) + (%timer-one-shot object)))) -(defun make-timer (function delay &key (name "A timer") one-shot thread) - (%make-timer name function (abs-timeout delay) delay one-shot thread)) +(defun make-timer (function delay &key (name "A timer") one-shot) + (%make-timer name function (abs-timeout delay) delay one-shot)) (defun timer-name (timer) (%timer-name timer)) -- 2.11.4.GIT