55
edits
m (→Thread safety) |
|||
| Line 48: | Line 48: | ||
=== Thread safety === | === Thread safety === | ||
Since strings are immutable, they are by definition thread safe. The only unsafe operation if the flattening operation. Therefore, the <tt>flatten()</tt> should look like this: | Since strings are immutable, they are by definition thread safe. The only unsafe operation if the flattening operation. Therefore, the <tt>flatten()</tt> implementation should look like this: | ||
void String::flatten() { | void String::flatten() { | ||
if (0 != this->treeLevel) { | if (0 != this->treeLevel) { | ||
edits