Table of Contents

Method GetThreadNum

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

GetThreadNum()

Returns the index of the currently executed thread within the current parallel region. Always returns 0 if called outside of parallel region. @deprecated Current implementation doesn't corresponding to this documentation. The exact meaning of the return value depends on the threading framework used by OpenCV library:

  • TBB - Unsupported with current 4.1 TBB release.Maybe will be supported in future.
  • OpenMP - The thread number, within the current team, of the calling thread.
  • Concurrency - An ID for the virtual processor that the current context is executing on(0 for master thread and unique number for others, but not necessary 1,2,3,...).
  • GCD - System calling thread's ID. Never returns 0 inside parallel region.
  • C= - The index of the current parallel task.
public static int GetThreadNum()

Returns

int