Self - Maple Help

Online Help

All Products    Maple    MapleSim


Threads

  

Self

  

return the thread identifier of the current thread

 

Calling Sequence

Description

Examples

Calling Sequence

Self()

Description

• 

The Self command returns the threads identifier of the current thread.

• 

For the main thread, the thread identifier is always 0.  For other threads, the thread identifier is an integer greater than 0.

Examples

idThreads:-CreateprintThreads:-Self

id1

(1)

Threads:-Waitid

n5

n5

(2)

t := table();
p := proc( t )
    t[ Threads:-Self() ] := 1;
end proc;

ttable

pproctt[Threads:-Self]1end proc

(3)

sseqThreads:-Creatept,i=1..n

s2,3,4,5,6

(4)

Threads:-Waitops

indicest

2,3,4,5,6

(5)

See Also

Threads

Threads[ConditionVariable]

Threads[Create]

Threads[Mutex]

Threads[Wait]