From: Roland Schulz Date: Wed, 14 May 2014 22:28:00 +0000 (-0400) Subject: Add comments for code with race condition X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=b4d6b4d9771de4bb204757e0d8c9b8440d3806c1;p=alexxy%2Fgromacs.git Add comments for code with race condition Change-Id: I89faa979ad605c463097e842e1112b2a24adee09 --- diff --git a/src/gromacs/gmxlib/nonbonded/nonbonded.c b/src/gromacs/gmxlib/nonbonded/nonbonded.c index fb8f43c47b..9efff8c5ed 100644 --- a/src/gromacs/gmxlib/nonbonded/nonbonded.c +++ b/src/gromacs/gmxlib/nonbonded/nonbonded.c @@ -656,6 +656,8 @@ do_nonbonded_listed(int ftype, int nbonds, if (r2 >= fr->tab14.r*fr->tab14.r) { + /* This check isn't race free. But it doesn't matter because if a race occurs the only + * disadvantage is that the warning is printed twice */ if (warned_rlimit == FALSE) { nb_listed_warning_rlimit(x, ai, aj, global_atom_index, sqrt(r2), fr->tab14.r); diff --git a/src/gromacs/mdlib/clincs.c b/src/gromacs/mdlib/clincs.c index 2a34e53ef8..cc9a9c98e0 100644 --- a/src/gromacs/mdlib/clincs.c +++ b/src/gromacs/mdlib/clincs.c @@ -648,6 +648,7 @@ static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc, dlen2 = 2*len2 - norm2(dx); if (dlen2 < wfac*len2 && (nlocat == NULL || nlocat[b])) { + /* not race free - see detailed comment in caller */ *warn = b; } if (dlen2 > 0)