Skip to content

Commit

Permalink
0.pre8.69
Browse files Browse the repository at this point in the history
	SMP safety: prefix thread synchronosation insns with LOCK

	Delete "waitpid pid -1" message on GC
  • Loading branch information
telent committed Apr 18, 2003
1 parent ca379af commit 5813c79
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/code/sysmacs.lisp
Expand Up @@ -23,8 +23,7 @@
#!+sb-thread
`(locally
(declare (optimize (safety 0) (speed 3)))
(sb!vm::fast-symbol-global-value-xadd ',symbol-name ,delta)
,symbol-name))
(sb!vm::locked-symbol-global-value-add ',symbol-name ,delta)))

(defmacro without-gcing (&rest body)
#!+sb-doc
Expand Down
22 changes: 17 additions & 5 deletions src/compiler/x86/cell.lisp
Expand Up @@ -145,13 +145,24 @@
(:policy :fast)
(:translate symbol-value))

(defknown fast-symbol-global-value-xadd (symbol fixnum) fixnum ())
(defknown locked-symbol-global-value-add (symbol fixnum) fixnum ())

(define-vop (fast-symbol-global-value-xadd cell-xadd)
(:variant symbol-value-slot other-pointer-lowtag)
(define-vop (locked-symbol-global-value-add)
(:args (object :scs (descriptor-reg) :to :result)
(value :scs (any-reg) :target result))
(:arg-types * tagged-num)
(:results (result :scs (any-reg) :from (:argument 1)))
(:policy :fast)
(:translate fast-symbol-global-value-xadd)
(:arg-types * tagged-num))
(:translate locked-symbol-global-value-add)
(:result-types tagged-num)
(:policy :fast-safe)
(:generator 4
(move result value)
(inst lock)
(inst add (make-ea :dword :base object
:disp (- (* symbol-value-slot n-word-bytes)
other-pointer-lowtag))
value)))

#!+sb-thread
(define-vop (boundp)
Expand Down Expand Up @@ -449,6 +460,7 @@
(:policy :fast-safe)
(:generator 5
(move eax old-value)
(inst lock)
(inst cmpxchg (make-ea :dword :base object :index slot :scale 1
:disp (- (* instance-slots-offset n-word-bytes)
instance-pointer-lowtag))
Expand Down
1 change: 0 additions & 1 deletion src/runtime/runtime.c
Expand Up @@ -469,7 +469,6 @@ static void /* noreturn */ parent_loop(void)
pid_t pid=0;
while(pid=waitpid(-1,&status,__WALL|WUNTRACED)) {
struct thread *th;
fprintf(stderr,"waitpid pid %d\n",pid);
if(pid==-1) {
if(errno == EINTR) {
if(maybe_gc_pending) parent_do_garbage_collect();
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/x86-arch.c
Expand Up @@ -146,7 +146,7 @@ get_spinlock(lispobj *word,int value)
{
u32 eax=0;
do {
asm ("xor %0,%0;cmpxchg %1,%2"
asm ("xor %0,%0;lock cmpxchg %1,%2"
: "=a" (eax)
: "r" (value), "m" (*word)
: "memory", "cc");
Expand Down
2 changes: 1 addition & 1 deletion version.lisp-expr
Expand Up @@ -18,4 +18,4 @@
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)

"0.pre8.68"
"0.pre8.69"

0 comments on commit 5813c79

Please sign in to comment.