On 03/23/2014 03:33 PM, Vincent van Ravesteijn wrote:
Richard Heck schreef op 23-3-2014 3:14:
Here is a new version of my idea for how to protect static variables
from thread problems.
The first patch introduces a template based on QThreadStorage which
acts kind of like a pointer. The second patch uses the first one to
protect some static variables used in the DocBook output routine.
The crucial case, as I mentioned before, is probably with the static
variables declared at the start of output_latex.cpp.
Comments?
Richard
The obvious comment is of course: Is it really necessary to have these
static variables, or was it just laziness of the programmer ? I don't
want to introduce QThreadStorage all over the place if it is not
really really the only solutions.
Yes, I agree. I marked one variable in BufferView.cpp this way: The one
that holds that last searched string. That might be better if it were
view-specific anyway.
The static variables in output_latex can be converted to member of
OutputParams ?
Possibly. I'll check.
Richard