diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | translate.cxx | 12 |
2 files changed, 16 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2005-08-31 Frank Ch. Eigler <fche@redhat.com> + + * translate.cxx (visit_array_in, visit_arrayindex): Use write locks + even for array reads, until PR 1275. + (translate_pass): Add read_trylock -> write_trylock escalation. + 2005-08-30 Roland McGrath <roland@redhat.com> * Makefile.am (install-data-local): Use mkdir -p, not -mkdir. diff --git a/translate.cxx b/translate.cxx index 6e68e7e3..8c29b020 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1785,7 +1785,8 @@ c_unparser::visit_array_in (array_in* e) { // block used to control varlock_r lifespan mapvar mvar = getmap (e->operand->referent, e->tok); - varlock_r guard (*this, mvar); + // XXX: should be varlock_r, but runtime arrays reads mutate + varlock_w guard (*this, mvar); o->newline() << mvar.seek (idx) << ";"; c_assign (res, mvar.exists(), e->tok); } @@ -2119,7 +2120,8 @@ c_unparser::visit_arrayindex (arrayindex* e) { // block used to control varlock_r lifespan mapvar mvar = getmap (e->referent, e->tok); - varlock_r guard (*this, mvar); + // XXX: should be varlock_r, but runtime arrays reads mutate + varlock_w guard (*this, mvar); o->newline() << mvar.seek (idx) << ";"; c_assign (res, mvar.get(), e->tok); } @@ -2320,6 +2322,12 @@ translate_pass (systemtap_session& s) // XXX s.op->newline() << "#define KALLSYMS_LOOKUP_NAME \"\""; s.op->newline() << "#define KALLSYMS_LOOKUP 0"; + // some older kernels don't have read_trylock, so pessimize. + // XXX: maybe read_trylock is never actually necessary + // for deadlock avoidance + s.op->newline() << "#ifndef read_trylock"; + s.op->newline() << "#define read_trylock write_trylock"; + s.op->newline() << "#endif"; s.op->newline() << "#endif"; s.up->emit_common_header (); |