~ chicken-core (chicken-5) bad303cc928e584cb709d34aef93f3af13273b73


commit bad303cc928e584cb709d34aef93f3af13273b73
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Sun Jan 21 13:27:22 2018 +0100
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Sat Feb 10 14:18:19 2018 +0100

    Move "sleep" into chicken.base and add "process-sleep" to chicken.process
    
    Signed-off-by: Peter Bex <peter@more-magic.net>

diff --git a/chicken.import.scm b/chicken.import.scm
index d0908e29..2a20eed3 100644
--- a/chicken.import.scm
+++ b/chicken.import.scm
@@ -145,7 +145,7 @@
    (setter . chicken.base#setter)
    (signal . chicken.condition#signal)
    (signum . chicken.base#signum)
-   sleep
+   (sleep . chicken.base#sleep)
    (software-type . chicken.platform#software-type)
    (software-version . chicken.platform#software-version)
    (string->uninterned-symbol . chicken.base#string->uninterned-symbol)
diff --git a/library.scm b/library.scm
index a8b2f184..d9a528e8 100644
--- a/library.scm
+++ b/library.scm
@@ -39,8 +39,8 @@
 	make-complex flonum->ratnum ratnum
 	+maximum-allowed-exponent+ mantexp->dbl ldexp round-quotient
 	##sys#string->compnum ##sys#internal-gcd)
-  (not inline ##sys#change-directory-hook ##sys#user-read-hook
-       ##sys#error-hook ##sys#signal-hook ##sys#sleep-hook
+  (not inline chicken.base#sleep-hook ##sys#change-directory-hook
+       ##sys#user-read-hook ##sys#error-hook ##sys#signal-hook
        ##sys#default-read-info-hook ##sys#infix-list-hook
        ##sys#sharp-number-hook ##sys#user-print-hook
        ##sys#user-interrupt-hook ##sys#windows-platform
@@ -5718,12 +5718,12 @@ EOF
 
 ;;; Sleeping:
 
-(define (##sys#sleep-hook n) ; modified by scheduler.scm
+(define (chicken.base#sleep-hook n) ; modified by scheduler.scm
   (##core#inline "C_i_process_sleep" n))
 
 (define (sleep n)
   (##sys#check-fixnum n 'sleep)
-  (##sys#sleep-hook n)
+  (chicken.base#sleep-hook n)
   (##core#undefined))
 
 
diff --git a/posix.scm b/posix.scm
index 24a96cf8..306983f5 100644
--- a/posix.scm
+++ b/posix.scm
@@ -174,7 +174,7 @@
    process-signal process-spawn process-wait call-with-input-pipe
    call-with-output-pipe close-input-pipe close-output-pipe create-pipe
    open-input-pipe open-output-pipe with-input-from-pipe
-   with-output-to-pipe process process* pipe/buf
+   with-output-to-pipe process process* process-sleep pipe/buf
    spawn/overlay spawn/wait spawn/nowait spawn/nowaito spawn/detach)
 
 (import chicken scheme chicken.posix chicken.platform)
diff --git a/scheduler.scm b/scheduler.scm
index cfb83306..670b0443 100644
--- a/scheduler.scm
+++ b/scheduler.scm
@@ -36,7 +36,7 @@
 	; ##sys#force-primordial
 	remove-from-ready-queue fdset-test create-fdset stderr delq
 	##sys#clear-i/o-state-for-thread! ##sys#abandon-mutexes) 
-  (not inline ##sys#interrupt-hook ##sys#sleep-hook ##sys#force-primordial)
+  (not inline chicken.base#sleep-hook ##sys#interrupt-hook ##sys#force-primordial)
   (unsafe)
   (foreign-declare #<<EOF
 #ifdef HAVE_ERRNO_H
@@ -597,7 +597,7 @@ EOF
 
 ;;; Override `sleep` in library.scm to operate on the current thread:
 
-(set! ##sys#sleep-hook
+(set! chicken.base#sleep-hook
   (lambda (n)
     (##sys#thread-sleep!
      (+ (##core#inline_allocate ("C_a_i_current_milliseconds" 7) #f)
diff --git a/types.db b/types.db
index b65647e1..df15b80d 100644
--- a/types.db
+++ b/types.db
@@ -948,6 +948,8 @@
 (chicken.base#implicit-exit-handler
  (#(procedure #:clean #:enforce) chicken.base#implicit-exit-handler (#!optional (procedure () . *)) procedure))
 
+(chicken.base#sleep (#(procedure #:clean #:enforce) chicken.base#sleep (fixnum) undefined))
+
 (chicken.base#exit (procedure chicken.base#exit (#!optional fixnum) noreturn))
 (chicken.base#exit-handler (#(procedure #:clean #:enforce) chicken.base#exit-handler (#!optional (procedure (fixnum) . *)) procedure))
 
@@ -1398,8 +1400,6 @@
 		((port string) (##sys#setslot #(1) '3 #(2))))
 
 
-(sleep (#(procedure #:clean #:enforce) sleep (fixnum) undefined))
-
 (symbol-escape (#(procedure #:clean) symbol-escape (#!optional *) *))
 
 (##sys#void (#(procedure #:pure) void (#!rest) undefined))
Trap