Skip to content

Commit

Permalink
'sync' function de-effective in sc-reply thread
Browse files Browse the repository at this point in the history
  • Loading branch information
byulparan authored and byulparan committed Aug 6, 2018
1 parent 28a8b7e commit ea6ba04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions server.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,14 @@
semaphore)))

(defun sync (&optional (rt-server *s*))
(when (typep rt-server 'rt-server)
(let* ((semaphore (get-semaphore-by-thread))
(id (assign-id-map-id (sync-id-map rt-server) semaphore)))
(send-message rt-server "/sync" id)
#+ccl (ccl:wait-on-semaphore semaphore)
#+sbcl (sb-thread:wait-on-semaphore semaphore)
#+ecl (mp:wait-on-semaphore semaphore))))
(if (eql (bt:current-thread) (sc-reply-thread rt-server)) nil
(when (typep rt-server 'rt-server)
(let* ((semaphore (get-semaphore-by-thread))
(id (assign-id-map-id (sync-id-map rt-server) semaphore)))
(send-message rt-server "/sync" id)
#+ccl (ccl:wait-on-semaphore semaphore)
#+sbcl (sb-thread:wait-on-semaphore semaphore)
#+ecl (mp:wait-on-semaphore semaphore)))))

(defmethod server-boot ((rt-server rt-server))
(when (boot-p rt-server) (error "SuperCollider server already running."))
Expand Down
2 changes: 1 addition & 1 deletion synthdef.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
(prog1 (setf (gethash ,key (node-proxy-table *s*))
(play ,body :id ,id :out-bus ,out-bus :fade ,fade :to ,to :pos ,pos :gain ,gain))
(cond ((not ,id) (clear-node))
((and ,node (/= (id ,node) ,id)) (clear-node))))))
((and ,node (/= (id ,node) ,id)) (clear-node))))))
`(clear-node))))))


Expand Down

0 comments on commit ea6ba04

Please sign in to comment.