Skip to content
  • Robert Fletcher's avatar
    929f9fd3
    Fix threading issue with strict locals · 929f9fd3
    Robert Fletcher authored
    Fixes #50774
    
    When the server boots up, 2 threads hit the same `UnboundTemplate`
    instance before it has set up `@templates`. Both threads get past the
    `unless template = @templates[locals]` check because
    `@templates[locals]` isn't set yet. However, with `@write_lock`, one
    thread waits while the other one proceeds, setting `@templates` to a
    frozen hash. The second thread then gets the write lock and tries to
    modify `@templates` but it has been frozen.
    929f9fd3
    Fix threading issue with strict locals
    Robert Fletcher authored
    Fixes #50774
    
    When the server boots up, 2 threads hit the same `UnboundTemplate`
    instance before it has set up `@templates`. Both threads get past the
    `unless template = @templates[locals]` check because
    `@templates[locals]` isn't set yet. However, with `@write_lock`, one
    thread waits while the other one proceeds, setting `@templates` to a
    frozen hash. The second thread then gets the write lock and tries to
    modify `@templates` but it has been frozen.
Loading