mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
sb-posix:fork: do finalizer-thread-stop.
This commit is contained in:
parent
3d8f544510
commit
19bff5cac3
|
|
@ -342,14 +342,19 @@
|
|||
the child process in the parent. Forking while multiple threads are running is
|
||||
not supported."
|
||||
(tagbody
|
||||
(sb-thread::with-all-threads-lock
|
||||
(when (cdr sb-thread::*all-threads*)
|
||||
(go :error))
|
||||
(let ((pid (posix-fork)))
|
||||
#+darwin
|
||||
(when (= pid 0)
|
||||
(darwin-reinit))
|
||||
(return-from fork pid)))
|
||||
(let ()
|
||||
#+sb-thread
|
||||
(sb-impl::finalizer-thread-stop)
|
||||
(sb-thread::with-all-threads-lock
|
||||
(when (cdr sb-thread::*all-threads*)
|
||||
(go :error))
|
||||
(let ((pid (posix-fork)))
|
||||
#+darwin
|
||||
(when (= pid 0)
|
||||
(darwin-reinit))
|
||||
#+sb-thread
|
||||
(setf sb-impl::*finalizer-thread* t)
|
||||
(return-from fork pid))))
|
||||
:error
|
||||
(error "Cannot fork with multiple threads running.")))
|
||||
(export 'fork :sb-posix)
|
||||
|
|
|
|||
Loading…
Reference in a new issue