Fixed-width strings: Difference between revisions

Jump to navigation Jump to search
m
Line 48: Line 48:
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> should look like this:
  void String::flatten() {
  void String::flatten() {
   if (0 != this.treeLevel) {
   if (0 != this->treeLevel) {
     ENTER_CRITICAL_SECTION;
     ENTER_CRITICAL_SECTION;
     if (0 != treeLevel) {
     if (0 != this->treeLevel) {
       // do the magic
       // do the magic
     }
     }
55

edits

Navigation menu