_ecl_sethash() used everywhere where locks are not required in ECL

This commit is contained in:
Juan Jose Garcia Ripoll 2010-01-20 17:38:08 +01:00
parent e2ffd24025
commit b91ca1c340
5 changed files with 20 additions and 20 deletions

View file

@ -201,7 +201,7 @@ make_this_symbol(int i, cl_object s, int code, const char *name,
s->symbol.name = make_constant_base_string(name);
if (package == cl_core.keyword_package) {
package->pack.external =
ecl_sethash(s->symbol.name, package->pack.external, s);
_ecl_sethash(s->symbol.name, package->pack.external, s);
ECL_SET(s, s);
} else {
int intern_flag;

View file

@ -331,9 +331,9 @@ ecl_intern(cl_object name, cl_object p, int *intern_flag)
if (p == cl_core.keyword_package) {
ecl_symbol_type_set(s, ecl_symbol_type(s) | stp_constant);
ECL_SET(s, s);
p->pack.external = ecl_sethash(name, p->pack.external, s);
p->pack.external = _ecl_sethash(name, p->pack.external, s);
} else {
p->pack.internal = ecl_sethash(name, p->pack.internal, s);
p->pack.internal = _ecl_sethash(name, p->pack.internal, s);
}
}
PACKAGE_OP_UNLOCK();
@ -481,7 +481,7 @@ cl_export2(cl_object s, cl_object p)
} end_loop_for_on;
if (hash != OBJNULL)
ecl_remhash(name, hash);
p->pack.external = ecl_sethash(name, p->pack.external, s);
p->pack.external = _ecl_sethash(name, p->pack.external, s);
OUTPUT:
PACKAGE_OP_UNLOCK();
}
@ -568,7 +568,7 @@ cl_unexport2(cl_object s, cl_object p)
(void)0;
} else {
ecl_remhash(name, p->pack.external);
p->pack.internal = ecl_sethash(name, p->pack.internal, s);
p->pack.internal = _ecl_sethash(name, p->pack.internal, s);
}
PACKAGE_OP_UNLOCK();
}
@ -597,7 +597,7 @@ cl_import2(cl_object s, cl_object p)
if (intern_flag == INTERNAL || intern_flag == EXTERNAL)
goto OUTPUT;
}
p->pack.internal = ecl_sethash(name, p->pack.internal, s);
p->pack.internal = _ecl_sethash(name, p->pack.internal, s);
symbol_add_package(s, p);
OUTPUT:
PACKAGE_OP_UNLOCK();
@ -632,7 +632,7 @@ ecl_shadowing_import(cl_object s, cl_object p)
symbol_remove_package(x, p);
}
p->pack.shadowings = CONS(s, p->pack.shadowings);
p->pack.internal = ecl_sethash(name, p->pack.internal, s);
p->pack.internal = _ecl_sethash(name, p->pack.internal, s);
OUTPUT:
PACKAGE_OP_UNLOCK();
}
@ -653,7 +653,7 @@ ecl_shadow(cl_object s, cl_object p)
x = find_symbol_inner(s, p, &intern_flag);
if (intern_flag != INTERNAL && intern_flag != EXTERNAL) {
x = cl_make_symbol(s);
p->pack.internal = ecl_sethash(s, p->pack.internal, x);
p->pack.internal = _ecl_sethash(s, p->pack.internal, x);
x->symbol.hpack = p;
}
p->pack.shadowings = CONS(x, p->pack.shadowings);

View file

@ -1724,7 +1724,7 @@ object_will_print_as_hash(cl_object x)
return !(code == OBJNULL || code == Cnil);
} else if (code == OBJNULL) {
/* Was not found before */
ecl_sethash(x, circle_stack, Cnil);
_ecl_sethash(x, circle_stack, Cnil);
return 0;
} else {
return 1;
@ -1750,11 +1750,11 @@ search_print_circle(cl_object x)
code = ecl_gethash_safe(x, circle_stack, OBJNULL);
if (code == OBJNULL) {
/* Was not found before */
ecl_sethash(x, circle_stack, Cnil);
_ecl_sethash(x, circle_stack, Cnil);
return 0;
} else if (code == Cnil) {
/* This object is referenced twice */
ecl_sethash(x, circle_stack, Ct);
_ecl_sethash(x, circle_stack, Ct);
return 1;
} else {
return 2;
@ -1763,13 +1763,13 @@ search_print_circle(cl_object x)
code = ecl_gethash_safe(x, circle_stack, OBJNULL);
if (code == OBJNULL || code == Cnil) {
/* Is not referenced or was not found before */
/* ecl_sethash(x, circle_stack, Cnil); */
/* _ecl_sethash(x, circle_stack, Cnil); */
return 0;
} else if (code == Ct) {
/* This object is referenced twice, but has no code yet */
cl_fixnum new_code = fix(circle_counter) + 1;
circle_counter = MAKE_FIXNUM(new_code);
ecl_sethash(x, circle_stack, circle_counter);
_ecl_sethash(x, circle_stack, circle_counter);
ECL_SETQ(ecl_process_env(), @'si::*circle-counter*',
circle_counter);
return -new_code;

View file

@ -1320,7 +1320,7 @@ do_patch_sharp(cl_object x, cl_object table)
}
default:;
}
ecl_sethash(x, table, x);
_ecl_sethash(x, table, x);
return x;
}
@ -1338,7 +1338,7 @@ patch_sharp(cl_object x)
pairs = ECL_SYM_VAL(the_env, @'si::*sharp-eq-context*');
loop_for_in(pairs) {
cl_object pair = ECL_CONS_CAR(pairs);
ecl_sethash(pair, table, ECL_CONS_CDR(pair));
_ecl_sethash(pair, table, ECL_CONS_CDR(pair));
} end_loop_for_in;
x = do_patch_sharp(x, table);
return x;
@ -1966,7 +1966,7 @@ ecl_readtable_set(cl_object readtable, int c, enum ecl_chattrib cat,
Ct);
readtable->readtable.hash = hash;
}
ecl_sethash(CODE_CHAR(c), hash,
_ecl_sethash(CODE_CHAR(c), hash,
CONS(MAKE_FIXNUM(cat), macro_or_table));
} else
#endif
@ -2064,7 +2064,7 @@ ecl_invalid_character_p(int c)
if (Null(fnc)) {
ecl_remhash(CODE_CHAR(subcode), table);
} else {
ecl_sethash(CODE_CHAR(subcode), table, fnc);
_ecl_sethash(CODE_CHAR(subcode), table, fnc);
}
if (ecl_lower_case_p(subcode)) {
subcode = ecl_char_upcase(subcode);
@ -2074,7 +2074,7 @@ ecl_invalid_character_p(int c)
if (Null(fnc)) {
ecl_remhash(CODE_CHAR(subcode), table);
} else {
ecl_sethash(CODE_CHAR(subcode), table, fnc);
_ecl_sethash(CODE_CHAR(subcode), table, fnc);
}
@(return Ct)
@)

View file

@ -90,7 +90,7 @@ ecl_bds_bind(cl_env_ptr env, cl_object s, cl_object value)
/* The previous binding was at most global */
slot->symbol = s;
slot->value = s->symbol.value;
ecl_sethash(s, bindings, value);
_ecl_sethash(s, bindings, value);
} else {
/* We have to save a dynamic binding */
slot->symbol = h->key;
@ -114,7 +114,7 @@ ecl_bds_push(cl_env_ptr env, cl_object s)
/* The previous binding was at most global */
slot->symbol = s;
slot->value = s->symbol.value;
ecl_sethash(s, bindings, s->symbol.value);
_ecl_sethash(s, bindings, s->symbol.value);
} else {
/* We have to save a dynamic binding */
slot->symbol = h->key;