Downgrade exclusive lock to shared lock when cloning a script (#400)
This commit is contained in:
parent
a419bfc93a
commit
f980e7e724
1 changed files with 2 additions and 2 deletions
|
@ -247,8 +247,8 @@ func (c *Compiled) RunContext(ctx context.Context) (err error) {
|
||||||
// Clone creates a new copy of Compiled. Cloned copies are safe for concurrent
|
// Clone creates a new copy of Compiled. Cloned copies are safe for concurrent
|
||||||
// use by multiple goroutines.
|
// use by multiple goroutines.
|
||||||
func (c *Compiled) Clone() *Compiled {
|
func (c *Compiled) Clone() *Compiled {
|
||||||
c.lock.Lock()
|
c.lock.RLock()
|
||||||
defer c.lock.Unlock()
|
defer c.lock.RUnlock()
|
||||||
|
|
||||||
clone := &Compiled{
|
clone := &Compiled{
|
||||||
globalIndexes: c.globalIndexes,
|
globalIndexes: c.globalIndexes,
|
||||||
|
|
Loading…
Reference in a new issue