Ignore:
Timestamp:
Sep 8, 2008, 5:49:20 AM (11 years ago)
Author:
gb
Message:

Windows changes (*ticks-per-second*, no nanosleep, time stuff.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-lisp-threads.lisp

    r10460 r10632  
    3030
    3131(defloadvar *ticks-per-second*
     32    #+windows-target 1000
     33    #-windows-target
    3234    (#_sysconf #$_SC_CLK_TCK))
    3335
     
    3537    (floor 1000000000 *ticks-per-second*))
    3638
     39#-windows-target
    3740(defun %nanosleep (seconds nanoseconds)
    3841  (with-process-whostate ("Sleep")
     
    7073     (round (pref tv :timeval.tv_usec) (floor 1000000 *ticks-per-second*))))
    7174
     75#-windows-target
    7276(defloadvar *lisp-start-timeval*
    7377    (progn
     
    8387  "Return the real time in the internal time format. (See
    8488  INTERNAL-TIME-UNITS-PER-SECOND.) This is useful for finding elapsed time."
     89  #-windows-target
    8590  (rlet ((tv :timeval))
    8691    (#_gettimeofday tv (%null-ptr))
     
    98103          (setq *internal-real-time-session-seconds*
    99104                (pref tv :timeval.tv_sec))
    100           units)))))
     105          units))))
     106  #+windows-target
     107  (rlet ((ft #>FILETIME))
     108    (#_GetSystemTimeAsFileTime ft)
     109    (values
     110     (floor (dpb (pref ft #>FILETIME.dwHighDateTime) (byte 32 32)
     111                (pref ft #>FILETIME.dwLowDateTime))
     112           (floor 10000000 internal-time-units-per-second)))))
    101113
    102114(defun get-tick-count ()
     
    417429        (setf (lisp-thread.tcr thread) nil
    418430              (lisp-thread.state thread) :exit)
     431        #+windows-target
     432        (#_TerminateThread pthread #$EXIT_FAILURE)
     433        #-windows-target
    419434        (#_pthread_kill pthread #$SIGQUIT)))))
    420435
Note: See TracChangeset for help on using the changeset viewer.