On 30/03/2010, Konstantin Kolinko <knst.koli...@gmail.com> wrote: > 2010/3/30 sebb <seb...@gmail.com>: > > > On 29/03/2010, ma...@apache.org <ma...@apache.org> wrote: > >> Author: markt > >> Date: Mon Mar 29 15:01:14 2010 > >> New Revision: 928798 > >> > >> URL: http://svn.apache.org/viewvc?rev=928798&view=rev > >> Log: > >> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48895 > >> Make clearing thread locals optional and disabled by default since it > isn't thread-safe > > > > However, the new boolean flag (clearReferencesThreadLocals) that > > controls the process is not safely published between threads. It > > should probably be volatile. > > > > > Startup is performed by a single thread, and it will set the value of > this field.
OK, in that case not a problem. However, it seems to me that this assumption should be documented in the StandardContext class. I think I saw a recent Bugzilla which suggested using multiple threads to speed startup, in which case the assumption might become incorrect. > According to the memory model all the threads started after that will > see the assigned value. Agreed; it's only a problem if two active threads access the same mutable variable. > I do not remember any of the "option value" fields in Tomcat being > marked as volatile. All of them are usual fields. > > Best regards, > > Konstantin Kolinko > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org