共用方式為


Context::Id Method

Returns an identifier for the current context that is unique within the scheduler to which the current context belongs.

static unsigned int __cdecl Id();

Return Value

If the current context is attached to a scheduler, an identifier for the current context that is unique within the scheduler to which the current context belongs; otherwise, the value -1.

Requirements

Header: concrt.h

Namespace: concurrency

See Also

Reference

Context Class