瀏覽代碼

added thread-safe support

Mark VandenBrink 12 年之前
父節點
當前提交
2436b58bcd
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 3 1
      taglib-tests.lisp
  2. 3 1
      taglib.asd

+ 3 - 1
taglib-tests.lisp

@@ -71,7 +71,8 @@
     (time (do-audio-dir :dir dir
             :file-system-encoding file-system-encoding :func nil))))
 
-;;;;;;;;;;;;;;;;;;;; multi-thread code below ;;;;;;;;;;;;;;;;;;;;
+;;;; multi-thread code below
+#+ENABLE-MP (progn
 (defparameter *end-thread*  #xdeadbeef)
 (defparameter *max-threads* 4)
 
@@ -176,3 +177,4 @@
   (set-pathname-encoding file-system-encoding)
   (let ((audio-streams:*get-audio-info* do-audio-processing))
     (time (mp-do-audio-dir :dir dir :file-system-encoding file-system-encoding :func nil))))
+)

+ 3 - 1
taglib.asd

@@ -2,11 +2,13 @@
 ;;; Copyright (c) 2013, Mark VandenBrink. All rights reserved.
 
 (pushnew :DBG *features*)
+;;; Theoretically, CLISP should run multi-threaded, but it keeps crashing...
+#+(or :ccl :sbcl :abcl) (pushnew :ENABLE-MP *features*)
 (asdf:defsystem #:taglib
   :description "Pure Lisp implementation to read (and write, perhaps, one day) tags"
   :author "Mark VandenBrink"
   :license "Public Domain"
-  :depends-on (#:optima #:optima.ppcre #:flexi-streams #:alexandria)
+  :depends-on (#:optima #:optima.ppcre #:flexi-streams #+ENABLE-MP #:bordeaux-threads)
   :components ((:file "packages")
                (:file "profile"       :depends-on ("packages"))
                (:file "utils"         :depends-on ("packages"))