diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index 7a2aa7a4..91e3927d 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -229,7 +229,7 @@ extern const object primitive_Cyc_91cvar_127; extern const object primitive_Cyc_91has_91cycle_127; extern const object primitive_Cyc_91spawn_91thread_67; extern const object primitive_Cyc_91end_91thread_67; -extern const object primitive_Cyc_91thread_91sleep_67; +extern const object primitive_thread_91sleep_67; extern const object primitive__87; extern const object primitive__91; extern const object primitive__85; diff --git a/runtime.c b/runtime.c index 77a4132d..0606400a 100644 --- a/runtime.c +++ b/runtime.c @@ -1709,8 +1709,8 @@ void _Cyc_91spawn_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); return_closcall1(data, cont, boolean_f); } -void _Cyc_91thread_91sleep_67(void *data, object cont, object args) { - Cyc_check_num_args(data, "Cyc-thread-sleep!", 1, args); +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 __87(void *data, object cont, object args) { integer_type argc = Cyc_length(data, args); @@ -2903,7 +2903,7 @@ 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_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_91thread_91sleep_67_primitive = {{0}, primitive_tag, "Cyc-thread-sleep!", &_Cyc_91thread_91sleep_67}; +static primitive_type thread_91sleep_67_primitive = {{0}, primitive_tag, "thread-sleep!", &_thread_91sleep_67}; static primitive_type _87_primitive = {{0}, primitive_tag, "+", &__87}; static primitive_type _91_primitive = {{0}, primitive_tag, "-", &__91}; static primitive_type _85_primitive = {{0}, primitive_tag, "*", &__85}; @@ -3023,7 +3023,7 @@ 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_91spawn_91thread_67 = &Cyc_91spawn_91thread_67_primitive; const object primitive_Cyc_91end_91thread_67 = &Cyc_91end_91thread_67_primitive; -const object primitive_Cyc_91thread_91sleep_67 = &Cyc_91thread_91sleep_67_primitive; +const object primitive_thread_91sleep_67 = &thread_91sleep_67_primitive; const object primitive__87 = &_87_primitive; const object primitive__91 = &_91_primitive; const object primitive__85 = &_85_primitive; @@ -3211,6 +3211,7 @@ void Cyc_end_thread(gc_thread_data *thd) // For now, accept a number of milliseconds to sleep object Cyc_thread_sleep(void *data, object timeout) { + // TODO: looks like there are overflow issues here: struct timespec tim; Cyc_check_num(data, timeout); tim.tv_sec = 0; diff --git a/scheme/cyclone/cgen.sld b/scheme/cyclone/cgen.sld index a2e2e58e..f6cdc891 100644 --- a/scheme/cyclone/cgen.sld +++ b/scheme/cyclone/cgen.sld @@ -452,7 +452,7 @@ ((eq? p 'Cyc-has-cycle?) "Cyc_has_cycle") ((eq? p 'Cyc-spawn-thread!) "Cyc_spawn_thread") ((eq? p 'Cyc-end-thread!) "Cyc_end_thread") - ((eq? p 'Cyc-thread-sleep!) "Cyc_thread_sleep") + ((eq? p 'thread-sleep!) "Cyc_thread_sleep") ((eq? p 'Cyc-stdout) "Cyc_stdout") ((eq? p 'Cyc-stdin) "Cyc_stdin") ((eq? p 'Cyc-stderr) "Cyc_stderr") @@ -584,7 +584,7 @@ apply Cyc-default-exception-handler Cyc-end-thread! - Cyc-thread-sleep! + thread-sleep! open-input-file open-output-file close-port diff --git a/scheme/cyclone/transforms.sld b/scheme/cyclone/transforms.sld index 9d115abb..290630e3 100644 --- a/scheme/cyclone/transforms.sld +++ b/scheme/cyclone/transforms.sld @@ -453,7 +453,7 @@ Cyc-has-cycle? Cyc-spawn-thread! Cyc-end-thread! - Cyc-thread-sleep! + thread-sleep! Cyc-stdout Cyc-stdin Cyc-stderr @@ -559,7 +559,7 @@ Cyc-cvar? Cyc-spawn-thread! Cyc-end-thread! - Cyc-thread-sleep! + thread-sleep! apply %halt exit diff --git a/scheme/eval.sld b/scheme/eval.sld index 1cabf452..2171b490 100644 --- a/scheme/eval.sld +++ b/scheme/eval.sld @@ -138,7 +138,7 @@ (list 'Cyc-has-cycle? Cyc-has-cycle?) (list 'Cyc-spawn-thread! Cyc-spawn-thread!) (list 'Cyc-end-thread! Cyc-end-thread!) - (list 'Cyc-thread-sleep! Cyc-thread-sleep!) + (list 'thread-sleep! thread-sleep!) (list 'Cyc-default-exception-handler Cyc-default-exception-handler) (list 'Cyc-current-exception-handler Cyc-current-exception-handler) (list '+ +)