Please sign in to comment.
Make autoload thread safe
The strategy here is to reuse the fact that require is already thread safe. This means we keep the autoload around and when a constant is defined, we add it to the autoload itself. Only the currently loading thread will see that constant for code loading. Other threads will still see the Autoload and try to load the file, this blocking until the loading is done and continue afterwards.
- Loading branch information...
Showing with 60 additions and 20 deletions.