mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 15:27:36 +02:00
Move thread-sleep! to 18.sld
This commit is contained in:
parent
d8dc9e7ccb
commit
1e71ff3fd3
6 changed files with 6 additions and 11 deletions
|
@ -233,7 +233,6 @@ extern const object primitive_Cyc_91cvar_127;
|
||||||
extern const object primitive_Cyc_91has_91cycle_127;
|
extern const object primitive_Cyc_91has_91cycle_127;
|
||||||
extern const object primitive_Cyc_91spawn_91thread_67;
|
extern const object primitive_Cyc_91spawn_91thread_67;
|
||||||
extern const object primitive_Cyc_91end_91thread_67;
|
extern const object primitive_Cyc_91end_91thread_67;
|
||||||
extern const object primitive_thread_91sleep_67;
|
|
||||||
extern const object primitive_Cyc_91minor_91gc;
|
extern const object primitive_Cyc_91minor_91gc;
|
||||||
extern const object primitive__87;
|
extern const object primitive__87;
|
||||||
extern const object primitive__91;
|
extern const object primitive__91;
|
||||||
|
|
|
@ -1783,9 +1783,6 @@ void _Cyc_91spawn_91thread_67(void *data, object cont, object args) {
|
||||||
void _Cyc_91end_91thread_67(void *data, object cont, object args) {
|
void _Cyc_91end_91thread_67(void *data, object cont, object args) {
|
||||||
Cyc_end_thread((gc_thread_data *)data);
|
Cyc_end_thread((gc_thread_data *)data);
|
||||||
return_closcall1(data, cont, boolean_f); }
|
return_closcall1(data, cont, boolean_f); }
|
||||||
void _thread_91sleep_67(void *data, object cont, object args) {
|
|
||||||
Cyc_check_num_args(data, "thread-sleep!", 1, args);
|
|
||||||
return_closcall1(data, cont, Cyc_thread_sleep(data, car(args))); }
|
|
||||||
void _Cyc_91minor_91gc_primitive(void *data, object cont, object args){
|
void _Cyc_91minor_91gc_primitive(void *data, object cont, object args){
|
||||||
Cyc_trigger_minor_gc(data, cont); }
|
Cyc_trigger_minor_gc(data, cont); }
|
||||||
void __87(void *data, object cont, object args) {
|
void __87(void *data, object cont, object args) {
|
||||||
|
@ -2526,7 +2523,6 @@ static primitive_type Cyc_91cvar_127_primitive = {{0}, primitive_tag, "Cyc-cvar?
|
||||||
static primitive_type Cyc_91has_91cycle_127_primitive = {{0}, primitive_tag, "Cyc-has-cycle?", &_Cyc_91has_91cycle_127};
|
static primitive_type Cyc_91has_91cycle_127_primitive = {{0}, primitive_tag, "Cyc-has-cycle?", &_Cyc_91has_91cycle_127};
|
||||||
static primitive_type Cyc_91spawn_91thread_67_primitive = {{0}, primitive_tag, "Cyc-spawn-thread!", &_Cyc_91spawn_91thread_67};
|
static primitive_type Cyc_91spawn_91thread_67_primitive = {{0}, primitive_tag, "Cyc-spawn-thread!", &_Cyc_91spawn_91thread_67};
|
||||||
static primitive_type Cyc_91end_91thread_67_primitive = {{0}, primitive_tag, "Cyc-end-thread!", &_Cyc_91end_91thread_67};
|
static primitive_type Cyc_91end_91thread_67_primitive = {{0}, primitive_tag, "Cyc-end-thread!", &_Cyc_91end_91thread_67};
|
||||||
static primitive_type thread_91sleep_67_primitive = {{0}, primitive_tag, "thread-sleep!", &_thread_91sleep_67};
|
|
||||||
static primitive_type Cyc_91minor_91gc_primitive = {{0}, primitive_tag, "Cyc-minor-gc", &_Cyc_91minor_91gc_primitive};
|
static primitive_type Cyc_91minor_91gc_primitive = {{0}, primitive_tag, "Cyc-minor-gc", &_Cyc_91minor_91gc_primitive};
|
||||||
static primitive_type _87_primitive = {{0}, primitive_tag, "+", &__87};
|
static primitive_type _87_primitive = {{0}, primitive_tag, "+", &__87};
|
||||||
static primitive_type _91_primitive = {{0}, primitive_tag, "-", &__91};
|
static primitive_type _91_primitive = {{0}, primitive_tag, "-", &__91};
|
||||||
|
@ -2651,7 +2647,6 @@ const object primitive_Cyc_91cvar_127 = &Cyc_91cvar_127_primitive;
|
||||||
const object primitive_Cyc_91has_91cycle_127 = &Cyc_91has_91cycle_127_primitive;
|
const object primitive_Cyc_91has_91cycle_127 = &Cyc_91has_91cycle_127_primitive;
|
||||||
const object primitive_Cyc_91spawn_91thread_67 = &Cyc_91spawn_91thread_67_primitive;
|
const object primitive_Cyc_91spawn_91thread_67 = &Cyc_91spawn_91thread_67_primitive;
|
||||||
const object primitive_Cyc_91end_91thread_67 = &Cyc_91end_91thread_67_primitive;
|
const object primitive_Cyc_91end_91thread_67 = &Cyc_91end_91thread_67_primitive;
|
||||||
const object primitive_thread_91sleep_67 = &thread_91sleep_67_primitive;
|
|
||||||
const object primitive_Cyc_91minor_91gc = &Cyc_91minor_91gc_primitive;
|
const object primitive_Cyc_91minor_91gc = &Cyc_91minor_91gc_primitive;
|
||||||
const object primitive__87 = &_87_primitive;
|
const object primitive__87 = &_87_primitive;
|
||||||
const object primitive__91 = &_91_primitive;
|
const object primitive__91 = &_91_primitive;
|
||||||
|
|
|
@ -455,7 +455,6 @@
|
||||||
((eq? p 'Cyc-has-cycle?) "Cyc_has_cycle")
|
((eq? p 'Cyc-has-cycle?) "Cyc_has_cycle")
|
||||||
((eq? p 'Cyc-spawn-thread!) "Cyc_spawn_thread")
|
((eq? p 'Cyc-spawn-thread!) "Cyc_spawn_thread")
|
||||||
((eq? p 'Cyc-end-thread!) "Cyc_end_thread")
|
((eq? p 'Cyc-end-thread!) "Cyc_end_thread")
|
||||||
((eq? p 'thread-sleep!) "Cyc_thread_sleep")
|
|
||||||
((eq? p 'Cyc-stdout) "Cyc_stdout")
|
((eq? p 'Cyc-stdout) "Cyc_stdout")
|
||||||
((eq? p 'Cyc-stdin) "Cyc_stdin")
|
((eq? p 'Cyc-stdin) "Cyc_stdin")
|
||||||
((eq? p 'Cyc-stderr) "Cyc_stderr")
|
((eq? p 'Cyc-stderr) "Cyc_stderr")
|
||||||
|
@ -593,7 +592,6 @@
|
||||||
Cyc-default-exception-handler
|
Cyc-default-exception-handler
|
||||||
Cyc-current-exception-handler
|
Cyc-current-exception-handler
|
||||||
Cyc-end-thread!
|
Cyc-end-thread!
|
||||||
thread-sleep!
|
|
||||||
open-input-file
|
open-input-file
|
||||||
open-output-file
|
open-output-file
|
||||||
close-port
|
close-port
|
||||||
|
|
|
@ -454,7 +454,6 @@
|
||||||
Cyc-has-cycle?
|
Cyc-has-cycle?
|
||||||
Cyc-spawn-thread!
|
Cyc-spawn-thread!
|
||||||
Cyc-end-thread!
|
Cyc-end-thread!
|
||||||
thread-sleep!
|
|
||||||
Cyc-minor-gc
|
Cyc-minor-gc
|
||||||
Cyc-stdout
|
Cyc-stdout
|
||||||
Cyc-stdin
|
Cyc-stdin
|
||||||
|
@ -565,7 +564,6 @@
|
||||||
Cyc-cvar?
|
Cyc-cvar?
|
||||||
Cyc-spawn-thread!
|
Cyc-spawn-thread!
|
||||||
Cyc-end-thread!
|
Cyc-end-thread!
|
||||||
thread-sleep!
|
|
||||||
Cyc-minor-gc
|
Cyc-minor-gc
|
||||||
apply
|
apply
|
||||||
%halt
|
%halt
|
||||||
|
|
|
@ -139,7 +139,6 @@
|
||||||
(list 'Cyc-has-cycle? Cyc-has-cycle?)
|
(list 'Cyc-has-cycle? Cyc-has-cycle?)
|
||||||
(list 'Cyc-spawn-thread! Cyc-spawn-thread!)
|
(list 'Cyc-spawn-thread! Cyc-spawn-thread!)
|
||||||
(list 'Cyc-end-thread! Cyc-end-thread!)
|
(list 'Cyc-end-thread! Cyc-end-thread!)
|
||||||
(list 'thread-sleep! thread-sleep!)
|
|
||||||
(list 'Cyc-default-exception-handler Cyc-default-exception-handler)
|
(list 'Cyc-default-exception-handler Cyc-default-exception-handler)
|
||||||
(list 'Cyc-current-exception-handler Cyc-current-exception-handler)
|
(list 'Cyc-current-exception-handler Cyc-current-exception-handler)
|
||||||
(list '+ +)
|
(list '+ +)
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
(define-library (srfi 18)
|
(define-library (srfi 18)
|
||||||
(import (scheme base))
|
(import (scheme base))
|
||||||
(export
|
(export
|
||||||
|
;; TODO: current-thread
|
||||||
thread?
|
thread?
|
||||||
make-thread
|
make-thread
|
||||||
thread-name
|
thread-name
|
||||||
thread-specific
|
thread-specific
|
||||||
thread-specific-set!
|
thread-specific-set!
|
||||||
thread-start!
|
thread-start!
|
||||||
|
thread-sleep!
|
||||||
thread-yield!
|
thread-yield!
|
||||||
; thread-terminate!
|
; thread-terminate!
|
||||||
; For now, these are built-ins. No need for them here: make-mutex mutex-lock! mutex-unlock!
|
; For now, these are built-ins. No need for them here: make-mutex mutex-lock! mutex-unlock!
|
||||||
|
@ -50,6 +52,10 @@
|
||||||
; (define (thread-terminate!) (Cyc-end-thread!))
|
; (define (thread-terminate!) (Cyc-end-thread!))
|
||||||
;; TODO: thread-join!
|
;; TODO: thread-join!
|
||||||
|
|
||||||
|
(define-c thread-sleep!
|
||||||
|
"(void *data, int argc, closure _, object k, object timeout)"
|
||||||
|
" return_closcall1(data, k, Cyc_thread_sleep(data, timeout)); ")
|
||||||
|
|
||||||
;; Take a single object and if it is on the stack, return a copy
|
;; Take a single object and if it is on the stack, return a copy
|
||||||
;; of it that is allocated on the heap. NOTE the original object
|
;; of it that is allocated on the heap. NOTE the original object
|
||||||
;; will still live on the stack, and will eventually be moved
|
;; will still live on the stack, and will eventually be moved
|
||||||
|
|
Loading…
Add table
Reference in a new issue