You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Christopher K. St. John" <ck...@distributopia.com> on 2002/01/25 22:57:51 UTC
StandardSession.expire() race?
There's code in StandardSession that looks like this:
public void expire(boolean notify)
if (expiring)
return;
expiring = true;
The test isn't thread safe, and it looks like it's
possible to have expire() called from the StandardManager
reaper thread and a servlet thread (through invalidate)
simultaneously.
'expiring' is tested in other places in StandardSession,
but I'm not sure enough of the possible call paths to tell
offhand if they're also dangerous.
I think it would be enough to declare expire volatile
and put a synchronized block around the test-and-set
in expire(), but I wanted to double check my logic
before I submitted a patch...
--
Christopher St. John cks@distributopia.com
DistribuTopia http://www.distributopia.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>