Skip to content

I20190312-1800

@iloveeclipse iloveeclipse tagged this 12 Mar 16:30
Allow threads read the char[] fields content only after the
corresponding flags are flipped *after* reading is done, not before.

This will avoid reads of uninitialized char[] data fields *without
locking* if multiple threads are entering get*() methods at the cost
that the data could be initialized multiple times. Fortunately, the data
is static so the result will be identical and the probability of
parallel initialization is pretty low to seriously affect performance.

Change-Id: Id96471940ebb6e8b3a839fb8c9a7aade9a179ea4
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Also-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Assets 2
Loading