Allegro: use built-in condition variables
authorJames M. Lawrence <llmjjmll@gmail.com>
Thu, 5 Jul 2012 22:21:26 +0000 (18:21 -0400)
committerStelian Ionescu <sionescu@cddr.org>
Sun, 29 Jul 2012 13:59:11 +0000 (15:59 +0200)
bordeaux-threads.asd
src/impl-allegro.lisp

index 62f4460..bed96f9 100644 (file)
@@ -7,7 +7,7 @@ Distributed under the MIT license (see LICENSE file)
 (in-package :cl-user)
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
-  #+allegro (require :process)
+  #+allegro (require :smputil)
   #+corman  (require :threads))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
index 144ee98..d9ea53b 100644 (file)
@@ -36,17 +36,13 @@ Distributed under the MIT license (see LICENSE file)
 ;;; Resource contention: condition variables
 
 (defun make-condition-variable (&key name)
-  (declare (ignore name))
-  (mp:make-gate nil))
+  (mp:make-condition-variable :name name))
 
 (defun condition-wait (condition-variable lock)
-  (release-lock lock)
-  (mp:process-wait "wait for message" #'mp:gate-open-p condition-variable)
-  (acquire-lock lock)
-  (mp:close-gate condition-variable))
+  (mp:condition-variable-wait condition-variable lock))
 
 (defun condition-notify (condition-variable)
-  (mp:open-gate condition-variable))
+  (mp:condition-variable-signal condition-variable))
 
 (defun thread-yield ()
   (mp:process-allow-schedule))