ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: wait for background thread
Date Tue, 26 Jul 2005 16:15:52 GMT
I would use a file as semaphore:
- the background thread creates a file as last instruction
- Ant uses <waitfor><available file=""/> for synchronizing


>-----Urspr√ľngliche Nachricht-----
>Von: Patrick Martin [] 
>Gesendet: Dienstag, 26. Juli 2005 18:08
>Betreff: wait for background thread
>Writing an task, I want to run some stuff in a background 
>thread, and I need ant to wait until the background thread is 
>done before exiting.
>I thought I would take example on the ant-contrib forget task, 
>but it seems that ant will exit even if the background thread is not
><target name="test">
>	<taskdef resource="net/sf/antcontrib/antlib.xml" />
>	<forget daemon="false">
>		<echo message="before wait" />
>		<waitfor maxwait="5" maxwaitunit="second">
>			<isset property="" />
>		</waitfor>
>		<echo message="after wait" />
>	</forget>
>Here is the output:
>     [echo] before wait
>Total time: 0 seconds
>I tested with the daemon attribute set to true and false. Same thing.
>What is the recommended way to run tasks in background and 
>ensure they will be executed before the exit of ant ?
>Thank you,
>To unsubscribe, e-mail: For 
>additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message