Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
c41ef3f0
Commit
c41ef3f0
authored
34 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Wrote a SLEEP based on mach:unix-select.
parent
a239d556
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/lispinit.lisp
+12
-24
12 additions, 24 deletions
code/lispinit.lisp
with
12 additions
and
24 deletions
code/lispinit.lisp
+
12
−
24
View file @
c41ef3f0
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC).
;;; **********************************************************************
;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/lispinit.lisp,v 1.1
2
1990/09/2
3 17:44:13
wlott Exp $
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/lispinit.lisp,v 1.1
3
1990/09/2
5 23:36:21
wlott Exp $
;;;
;;; Initialization and low-level interrupt support for the Spice Lisp system.
;;; Written by Skef Wholey and Rob MacLachlan.
...
...
@@ -615,34 +615,22 @@
(
throw
'%end-of-the-world
nil
)))
#| might be something different.
(defalien sleep-msg mach:msg (record-size 'mach:msg))
(setf (alien-access (mach:msg-simplemsg sleep-msg)) T)
(setf (alien-access (mach:msg-msgtype sleep-msg)) 0)
(setf (alien-access (mach:msg-msgsize sleep-msg))
(/ (record-size 'mach:msg) 8))
;;; Currently there is a bug in the Mach timeout code that if the timeout
;;; period is too short the receive never returns.
(
defun
sleep
(
n
)
"This function causes execution to be suspended for N seconds. N may
be any non-negative, non-complex number."
(with-reply-port (sleep-port)
(let ((m (round (* 1000 n))))
(cond ((minusp m)
(error "Argument to Sleep, ~S, is a negative number." n))
((zerop m))
(t
(setf (alien-access (mach:msg-localport sleep-msg)) sleep-port)
(let ((gr (mach:msg-receive sleep-msg mach:rcv-timeout m)))
(unless (eql gr mach:rcv-timed-out)
(gr-error 'mach:receive gr)))))))
(
when
(
or
(
not
(
realp
n
))
(
minusp
n
))
(
error
"Invalid argument to SLEEP: ~S.~%~
Must be a non-negative, non-complex number."
n
))
(
multiple-value-bind
(
sec
usec
)
(
if
(
integerp
n
)
(
values
n
0
)
(
values
(
truncate
n
)
(
truncate
(
*
n
1000000
))))
(
mach:unix-select
0
0
0
0
sec
usec
))
nil
)
|#
;;;; TOP-LEVEL loop.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment