Wait - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Threads

  

Wait

  

wait for a thread to finish

 

Calling Sequence

Parameters

Description

Examples

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

withThreads

Add,ConditionVariable,Create,Map,Mul,Mutex,Self,Seq,Sleep,Task,Wait

(1)

p := proc( limit )
   local now, start;
   start := time[real]();
   now := start;
   
   while now - start < limit        
   do
       Threads:-Sleep( 0.1 );
       now := time[real]();
   end;

   return now-start;
end:

idCreatep1&comma;out&colon;

Waitid&colon;

out

1.003

(2)

id1Createp1&comma;out1&colon;

id2Createp2&comma;out2&colon;

Waitid1&comma;id2&colon;

out1

1.002

(3)

out2

2.015

(4)

See Also

Threads

Threads[ConditionVariable]

Threads[Create]

Threads[Mutex]

Threads[Self]