Wait - Maple Help

 Wait
 wait for a thread to finish

 Calling Sequence Wait( id1, id2, ... )

Parameters

 id1, id2, ... - (integer) thread identifiers

Description

 • The Wait command pauses the current thread until the threads specified as arguments finish.

Examples

 > $\mathrm{with}\left(\mathrm{Threads}\right)$
 $\left[{\mathrm{Add}}{,}{\mathrm{ConditionVariable}}{,}{\mathrm{Create}}{,}{\mathrm{Map}}{,}{\mathrm{Mul}}{,}{\mathrm{Mutex}}{,}{\mathrm{Self}}{,}{\mathrm{Seq}}{,}{\mathrm{Sleep}}{,}{\mathrm{Task}}{,}{\mathrm{Wait}}\right]$ (1)
 > $\mathrm{id}≔\mathrm{Create}\left(\mathrm{int}\left({\mathrm{sin}\left(x\right)}^{x},x\right),d\right)$
 ${\mathrm{id}}{≔}{1}$ (2)
 > $d$
 ${d}$ (3)
 > $\mathrm{Wait}\left(\mathrm{id}\right)$
 > $d$
 ${\int }{{\mathrm{sin}}{}\left({x}\right)}^{{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (4)
 > $\mathrm{id1}≔\mathrm{Create}\left(\mathrm{int}\left({\left(\frac{1}{x}\right)}^{x},x\right),\mathrm{d1}\right)$
 ${\mathrm{id1}}{≔}{2}$ (5)
 > $\mathrm{id2}≔\mathrm{Create}\left(\mathrm{int}\left({x}^{x},x\right),\mathrm{d2}\right)$
 ${\mathrm{id2}}{≔}{3}$ (6)
 > $\mathrm{d1},\mathrm{d2}$
 ${\mathrm{d1}}{,}{\mathrm{d2}}$ (7)
 > $\mathrm{Wait}\left(\mathrm{id1},\mathrm{id2}\right)$
 > $\mathrm{d1},\mathrm{d2}$
 ${\int }{\left(\frac{{1}}{{x}}\right)}^{{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}{,}{\int }{{x}}^{{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (8)
 >