Commit a74589b5 authored by Sebastian Biewer's avatar Sebastian Biewer

Fixing concurrency during struct initialization

parent d224dd41
......@@ -798,6 +798,7 @@ class PCCConstructor
envArgCount = @delegate.constructorProtectEnvironmentArguments(@, @compiler, variables, @context)
vars = []
vars.unshift(@compiler.unprotectContainer()) for i in [0...envArgCount]
@compiler.emitOutput("class_#{@delegate.getName()}_initialized", vars[0], null) # vars[0] is the instance number of the object being created
recursion = @delegate.constructorShouldCallRecursively?(@, @context)
control = null
control = @compiler.emitParallel() if recursion and hasEnvironment
......
......@@ -286,6 +286,7 @@ PC.ClassType::createContainer = (compiler, container) ->
return container if container
result = compiler.getFreshContainer(PCCType.INT)
compiler.emitInput("class_#{@identifier}_create", null, result)
compiler.emitInput("class_#{@identifier}_initialized", result, null)
result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment