Skip to main content
AvRtJoinThreadOrderingGroup function

Joins client threads to a thread ordering group.


BOOL WINAPI AvRtJoinThreadOrderingGroup(
  _Out_ PHANDLE Context,
  _In_  GUID    *ThreadOrderingGuid,
  _In_  BOOL    Before


Context [out]

A pointer to a context handle.

ThreadOrderingGuid [in]

A pointer to the unique identifier for the thread ordering group.

Before [in]

The thread order. If this parameter is TRUE, the thread is a predecessor thread that is scheduled to run before the parent thread. If this parameter is FALSE, the thread is a successor thread that is scheduled to run after the parent thread.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


The thread encloses the code to be executed during each period within a loop that is controlled by the AvRtWaitOnThreadOrderingGroup function.

A thread can create more than one thread ordering group and join more than one thread ordering group. However, a thread cannot join the same thread ordering group more than one time.

The number of threads that can join a group is limited only by available system resources.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]







See also

Thread Ordering Service