Skip to content

Target locked Attribute

nathanscottdaniels edited this page Oct 17, 2016 · 1 revision

Target locked Attribute

An optional attribute has been added to the <target/> element called locked. This is a Boolean value that, when true, forces the target to only be executed by one thread at a time.

WARNING: Do not use this attribute on targets that could possibly end up calling themselves as this will cause a deadlock.

Example

<target name="critical" locked="true">
    <!-- Thread unsafe stuff here -->
<target/>

<target name="build">
    <parallel>
        <pcall target="critical"/>
        <pcall target="critical"/>
    </parallel>
</target>

In the above example, calling the build target would result in the critical target being called twice sequentially. rather than in parallel, despite it being in the <parallel> task.

Clone this wiki locally