Closed zeripath closed 3 years ago
Basically there are two options here.
This one uses the standard RWMutex instead of Atomics which allows us to keep the mutex around for use in other situations - e.g. if we want to/need to lock on other parts of the Render in future we're going to need to keep a mutex around.
I've closed #91 as I think this locking approach is better and allows us to use-fsnotify in the directory system.
It's better that the lock is only in the templates
and not exposed to render.
The templates
could have init
, lookup
and compile
methods.
And if development
is a compile-time setting, we could have two implementations for templates to be lock free in production mode.
@zeripath Can this one be closed now?
yup can be closed!
As a second step improving #90, only lock when absolutely necessary and reconstruct functions to ensure that the current templates are referenced in the helper func instead of a global reference.
Signed-off-by: Andrew Thornton art27@cantab.net