Ignore:
Timestamp:
Oct 14, 2008, 6:30:00 PM (13 years ago)
Author:
gz
Message:

Merge/bootstrap assorted low level stuff from trunk - kernel, syscall stuff, lowmem-bias, formatting tweaks, a few bug fixes included

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/l1-lisp-threads.lisp

    r10531 r11089  
    2727  (istruct-typep thing 'lisp-thread))
    2828
    29 
    3029(defloadvar *ticks-per-second*
     30    #+windows-target 1000
     31    #-windows-target
    3132    (#_sysconf #$_SC_CLK_TCK))
    3233
     
    3435    (floor 1000000000 *ticks-per-second*))
    3536
     37#-windows-target
    3638(defun %nanosleep (seconds nanoseconds)
    3739  (with-process-whostate ("Sleep")
     
    6971     (round (pref tv :timeval.tv_usec) (floor 1000000 *ticks-per-second*))))
    7072
     73
     74(defun gettimeofday (ptimeval &optional ptz)
     75  (int-errno-ffcall (%kernel-import target::kernel-import-lisp-gettimeofday)
     76                    :address ptimeval
     77                    :address (or ptz (%null-ptr))
     78                    :int))
     79
    7180(defloadvar *lisp-start-timeval*
    7281    (progn
    7382      (let* ((r (make-record :timeval)))
    74         (#_gettimeofday r (%null-ptr))
     83        (gettimeofday r)
    7584        r)))
    7685
     
    8392  INTERNAL-TIME-UNITS-PER-SECOND.) This is useful for finding elapsed time."
    8493  (rlet ((tv :timeval))
    85     (#_gettimeofday tv (%null-ptr))
     94    (gettimeofday tv)
    8695    (let* ((units (truncate (the fixnum (pref tv :timeval.tv_usec)) (/ 1000000 internal-time-units-per-second)))
    8796           (initial *internal-real-time-session-seconds*))
     
    416425        (setf (lisp-thread.tcr thread) nil
    417426              (lisp-thread.state thread) :exit)
     427        #+windows-target
     428        (#_TerminateThread pthread #$EXIT_FAILURE)
     429        #-windows-target
    418430        (#_pthread_kill pthread #$SIGQUIT)))))
    419431
Note: See TracChangeset for help on using the changeset viewer.