Refactored code structure
This commit is contained in:
19
src/build/core/CompileAllFunctions.go
Normal file
19
src/build/core/CompileAllFunctions.go
Normal file
@ -0,0 +1,19 @@
|
||||
package core
|
||||
|
||||
import "sync"
|
||||
|
||||
// CompileAllFunctions starts a goroutine for each function compilation and waits for completion.
|
||||
func CompileAllFunctions(functions map[string]*Function) {
|
||||
wg := sync.WaitGroup{}
|
||||
|
||||
for _, function := range functions {
|
||||
wg.Add(1)
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
function.Compile()
|
||||
}()
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
}
|
Reference in New Issue
Block a user