diff options
author | Andy Wingo <wingo@pobox.com> | 2016-09-06 11:04:25 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-09-06 11:16:53 +0200 |
commit | 3425290a7b1249b8901eabf089869846d05eeb1e (patch) | |
tree | fe25ea31f8a11eb3843854b3f6cc8cdb7d04d00a /libguile/goops.c | |
parent | 7cdaf0e27b8b7c22b6ca3900eafc3ffeacb62bc9 (diff) | |
download | guile-3425290a7b1249b8901eabf089869846d05eeb1e.tar.gz |
Add atomic boxes
* doc/ref/api-scheduling.texi (Atomics): New manual section.
* libguile.h: Include atomic.h.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
(DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add atomic.
* libguile/atomic.c:
* libguile/atomic.h: New files.
* libguile/atomics-internal.h (scm_atomic_set_scm, scm_atomic_ref_scm)
(scm_atomic_swap_scm, scm_atomic_compare_and_swap_scm): New
facilities.
* libguile/goops.c (class_atomic_box, scm_sys_goops_early_init): Add
support for <atomic-box>. Remove duplicate <keyword> fetch.
* libguile/init.c (scm_i_init_guile): Call scm_register_atomic_box.
* libguile/print.c (iprin1): Add atomic box case.
* libguile/tags.h (scm_tc7_atomic_box): New tag.
* libguile/validate.h (SCM_VALIDATE_ATOMIC_BOX): New macro.
* module/Makefile.am (SOURCES): Add ice-9/atomic.scm.
* module/ice-9/atomic.scm: New file.
* module/oop/goops.scm (<atomic-box>): New var.
Diffstat (limited to 'libguile/goops.c')
-rw-r--r-- | libguile/goops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/goops.c b/libguile/goops.c index 3ed60d3f3..4e28d06fb 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -110,6 +110,7 @@ static SCM class_applicable_struct_class; static SCM class_applicable_struct_with_setter_class; static SCM class_number, class_list; static SCM class_keyword; +static SCM class_atomic_box; static SCM class_port, class_input_output_port; static SCM class_input_port, class_output_port; static SCM class_foreign_slot; @@ -124,7 +125,6 @@ static SCM class_hashtable; static SCM class_fluid; static SCM class_dynamic_state; static SCM class_frame; -static SCM class_keyword; static SCM class_vm_cont; static SCM class_bytevector; static SCM class_uvec; @@ -227,6 +227,8 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0, return class_frame; case scm_tc7_keyword: return class_keyword; + case scm_tc7_atomic_box: + return class_atomic_box; case scm_tc7_vm_cont: return class_vm_cont; case scm_tc7_bytevector: @@ -998,6 +1000,7 @@ SCM_DEFINE (scm_sys_goops_early_init, "%goops-early-init", 0, 0, 0, class_dynamic_state = scm_variable_ref (scm_c_lookup ("<dynamic-state>")); class_frame = scm_variable_ref (scm_c_lookup ("<frame>")); class_keyword = scm_variable_ref (scm_c_lookup ("<keyword>")); + class_atomic_box = scm_variable_ref (scm_c_lookup ("<atomic-box>")); class_vm_cont = scm_variable_ref (scm_c_lookup ("<vm-continuation>")); class_bytevector = scm_variable_ref (scm_c_lookup ("<bytevector>")); class_uvec = scm_variable_ref (scm_c_lookup ("<uvec>")); @@ -1008,7 +1011,6 @@ SCM_DEFINE (scm_sys_goops_early_init, "%goops-early-init", 0, 0, 0, class_real = scm_variable_ref (scm_c_lookup ("<real>")); class_integer = scm_variable_ref (scm_c_lookup ("<integer>")); class_fraction = scm_variable_ref (scm_c_lookup ("<fraction>")); - class_keyword = scm_variable_ref (scm_c_lookup ("<keyword>")); class_unknown = scm_variable_ref (scm_c_lookup ("<unknown>")); class_procedure = scm_variable_ref (scm_c_lookup ("<procedure>")); class_primitive_generic = scm_variable_ref (scm_c_lookup ("<primitive-generic>")); |