blob: cb4c9f3e1f332ae35eeb83ecc651a5fc0d06231c [file] [log] [blame]
<?xml version="1.0"?>
<!--
Copyright 2002-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This test shows coordinating between 2 threads using
mutexes with wait/notify. Numbers between threads
should increment together.
-->
<jelly xmlns="jelly:core" xmlns:threads="jelly:threads">
<threads:thread var="thread1">
<whitespace>
thread1: going to sleep for 2 seconds
</whitespace>
<threads:sleep for="2000"/>
</threads:thread>
<threads:thread var="thread2">
<threads:waitfor thread="${thread1}"/>
<whitespace>
thread2: finished waiting for thread1, sleeping for 2 seconds
</whitespace>
<threads:sleep for="1000"/>
</threads:thread>
<threads:thread>
<threads:waitfor thread="${thread1}"/>
<whitespace>
thread3: finished waiting for thread1
</whitespace>
</threads:thread>
<threads:thread>
<threads:waitfor thread="${thread2}"/>
<whitespace>
thread4: finished waiting for thread2
</whitespace>
</threads:thread>
</jelly>