Various fixes
parent
75c077ebd5
commit
279aeddeb3
|
@ -4,3 +4,4 @@ IN: bootstrap.threads
|
||||||
|
|
||||||
USE: io.thread
|
USE: io.thread
|
||||||
USE: threads
|
USE: threads
|
||||||
|
USE: debugger.threads
|
||||||
|
|
|
@ -4,7 +4,7 @@ IN: concurrency.mailboxes
|
||||||
USING: dlists dequeues threads sequences continuations
|
USING: dlists dequeues threads sequences continuations
|
||||||
destructors namespaces random math quotations words kernel
|
destructors namespaces random math quotations words kernel
|
||||||
arrays assocs init system concurrency.conditions accessors
|
arrays assocs init system concurrency.conditions accessors
|
||||||
debugger ;
|
debugger debugger.threads ;
|
||||||
|
|
||||||
TUPLE: mailbox threads data disposed ;
|
TUPLE: mailbox threads data disposed ;
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@ kernel math namespaces prettyprint prettyprint.config sequences
|
||||||
assocs sequences.private strings io.styles io.files vectors
|
assocs sequences.private strings io.styles io.files vectors
|
||||||
words system splitting math.parser classes.tuple continuations
|
words system splitting math.parser classes.tuple continuations
|
||||||
continuations.private combinators generic.math classes.builtin
|
continuations.private combinators generic.math classes.builtin
|
||||||
classes compiler.units generic.standard vocabs threads
|
classes compiler.units generic.standard vocabs init
|
||||||
threads.private init kernel.private libc io.encodings accessors
|
kernel.private io.encodings accessors math.order
|
||||||
math.order destructors source-files parser classes.tuple.parser
|
destructors source-files parser classes.tuple.parser
|
||||||
effects.parser lexer compiler.errors dlists generic.parser
|
effects.parser lexer compiler.errors generic.parser
|
||||||
strings.parser ;
|
strings.parser ;
|
||||||
IN: debugger
|
IN: debugger
|
||||||
|
|
||||||
|
@ -245,33 +245,6 @@ M: no-compilation-unit error.
|
||||||
M: no-vocab summary
|
M: no-vocab summary
|
||||||
drop "Vocabulary does not exist" ;
|
drop "Vocabulary does not exist" ;
|
||||||
|
|
||||||
M: bad-ptr summary
|
|
||||||
drop "Memory allocation failed" ;
|
|
||||||
|
|
||||||
M: double-free summary
|
|
||||||
drop "Free failed since memory is not allocated" ;
|
|
||||||
|
|
||||||
M: realloc-error summary
|
|
||||||
drop "Memory reallocation failed" ;
|
|
||||||
|
|
||||||
: error-in-thread. ( thread -- )
|
|
||||||
"Error in thread " write
|
|
||||||
[
|
|
||||||
dup thread-id #
|
|
||||||
" (" % dup thread-name %
|
|
||||||
", " % dup thread-quot unparse-short % ")" %
|
|
||||||
] "" make swap write-object ":" print nl ;
|
|
||||||
|
|
||||||
! Hooks
|
|
||||||
M: thread error-in-thread ( error thread -- )
|
|
||||||
initial-thread get-global eq? [
|
|
||||||
die drop
|
|
||||||
] [
|
|
||||||
global [
|
|
||||||
error-thread get-global error-in-thread. print-error flush
|
|
||||||
] bind
|
|
||||||
] if ;
|
|
||||||
|
|
||||||
M: encode-error summary drop "Character encoding error" ;
|
M: encode-error summary drop "Character encoding error" ;
|
||||||
|
|
||||||
M: decode-error summary drop "Character decoding error" ;
|
M: decode-error summary drop "Character decoding error" ;
|
||||||
|
@ -348,9 +321,6 @@ M: object compiler-error. ( error word -- )
|
||||||
nl
|
nl
|
||||||
print-error ;
|
print-error ;
|
||||||
|
|
||||||
M: empty-dlist summary ( dlist -- )
|
|
||||||
drop "Empty dlist" ;
|
|
||||||
|
|
||||||
M: bad-effect summary
|
M: bad-effect summary
|
||||||
drop "Bad stack effect declaration" ;
|
drop "Bad stack effect declaration" ;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: accessors debugger continuations threads threads.private
|
||||||
|
io io.styles prettyprint kernel math.parser namespaces ;
|
||||||
|
IN: debugger.threads
|
||||||
|
|
||||||
|
: error-in-thread. ( thread -- )
|
||||||
|
"Error in thread " write
|
||||||
|
[
|
||||||
|
dup id>> #
|
||||||
|
" (" % dup name>> %
|
||||||
|
", " % dup quot>> unparse-short % ")" %
|
||||||
|
] "" make swap write-object ":" print nl ;
|
||||||
|
|
||||||
|
M: thread error-in-thread ( error thread -- )
|
||||||
|
initial-thread get-global eq? [
|
||||||
|
die drop
|
||||||
|
] [
|
||||||
|
global [
|
||||||
|
error-thread get-global error-in-thread. print-error flush
|
||||||
|
] bind
|
||||||
|
] if ;
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2007, 2008 Mackenzie Straight, Doug Coleman,
|
! Copyright (C) 2007, 2008 Mackenzie Straight, Doug Coleman,
|
||||||
! Slava Pestov.
|
! Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: combinators kernel math sequences accessors dequeues ;
|
USING: combinators kernel math sequences accessors dequeues
|
||||||
|
summary ;
|
||||||
IN: dlists
|
IN: dlists
|
||||||
|
|
||||||
TUPLE: dlist front back length ;
|
TUPLE: dlist front back length ;
|
||||||
|
@ -80,6 +81,9 @@ M: dlist push-back* ( obj dlist -- dlist-node )
|
||||||
|
|
||||||
ERROR: empty-dlist ;
|
ERROR: empty-dlist ;
|
||||||
|
|
||||||
|
M: empty-dlist summary ( dlist -- )
|
||||||
|
drop "Empty dlist" ;
|
||||||
|
|
||||||
M: dlist peek-front ( dlist -- obj )
|
M: dlist peek-front ( dlist -- obj )
|
||||||
front>> [ obj>> ] [ empty-dlist ] if* ;
|
front>> [ obj>> ] [ empty-dlist ] if* ;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
! Copyright (C) 2007, 2008 Doug Coleman
|
! Copyright (C) 2007, 2008 Doug Coleman
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien assocs continuations destructors kernel
|
USING: alien assocs continuations destructors kernel
|
||||||
namespaces accessors sets ;
|
namespaces accessors sets summary ;
|
||||||
IN: libc
|
IN: libc
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
@ -34,13 +34,22 @@ PRIVATE>
|
||||||
|
|
||||||
ERROR: bad-ptr ;
|
ERROR: bad-ptr ;
|
||||||
|
|
||||||
|
M: bad-ptr summary
|
||||||
|
drop "Memory allocation failed" ;
|
||||||
|
|
||||||
: check-ptr ( c-ptr -- c-ptr )
|
: check-ptr ( c-ptr -- c-ptr )
|
||||||
[ bad-ptr ] unless* ;
|
[ bad-ptr ] unless* ;
|
||||||
|
|
||||||
ERROR: double-free ;
|
ERROR: double-free ;
|
||||||
|
|
||||||
|
M: double-free summary
|
||||||
|
drop "Free failed since memory is not allocated" ;
|
||||||
|
|
||||||
ERROR: realloc-error ptr size ;
|
ERROR: realloc-error ptr size ;
|
||||||
|
|
||||||
|
M: realloc-error summary
|
||||||
|
drop "Memory reallocation failed" ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: add-malloc ( alien -- )
|
: add-malloc ( alien -- )
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespaces continuations layouts accessors ;
|
||||||
|
|
||||||
[ t ] [ 1300000 small-enough? ] unit-test
|
[ t ] [ 1300000 small-enough? ] unit-test
|
||||||
|
|
||||||
[ "staging.math-compiler-ui-strip.image" ] [
|
[ "staging.threads-math-compiler-ui-strip.image" ] [
|
||||||
"hello-ui" deploy-config
|
"hello-ui" deploy-config
|
||||||
[ bootstrap-profile staging-image-name file-name ] bind
|
[ bootstrap-profile staging-image-name file-name ] bind
|
||||||
] unit-test
|
] unit-test
|
||||||
|
@ -79,7 +79,7 @@ M: quit-responder call-responder*
|
||||||
[
|
[
|
||||||
<dispatcher>
|
<dispatcher>
|
||||||
add-quot-responder
|
add-quot-responder
|
||||||
"resource:basis/http/test" <static> >>default
|
"resource:extra/http/test" <static> >>default
|
||||||
main-responder set
|
main-responder set
|
||||||
|
|
||||||
test-httpd
|
test-httpd
|
||||||
|
|
Loading…
Reference in New Issue