tmf: Fix reading HTNodes while the tree is being built
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 23 Jan 2014 05:16:03 +0000 (00:16 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 27 Jan 2014 19:37:45 +0000 (14:37 -0500)
commit045badfe7ba11d619fda0d6d393f43080a42869b
tree2d331d52a40d192c8cd97a94891693c50b003543
parentf45257df5af101ec2dcabb963a5256926fe88767
tmf: Fix reading HTNodes while the tree is being built

A race condition could occur if a node would receive a query
after closeThisNode() was called, but before it was finished
writing itself to disk (in writeSelf()). It would result in
BufferUnderflowException's.

The important part of this patch is moving the "isDone" from
closeThisNode() to the end of writeSelf().

Also renamed the flag to isOnDisk, to reflect better what it
represents. It wouldn't even need to be written to the file,
but since a change in the file format is due soon-ish, might
as well change it all at the same time.

Change-Id: Ib22e3d56538057c7b3fd6655d32597b524fd8b28
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/20984
Tested-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
IP-Clean: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HTNode.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTree.java
This page took 0.039089 seconds and 5 git commands to generate.