DirectShow Animated Header -- CCritSec Debug Functions DirectShow Animated Header -- CCritSec Debug Functions* Microsoft DirectShow SDK
*Index  *Topic Contents
*Previous Topic: CBaseRenderer Callback Function
*Next Topic: Conversion Functions

CCritSec Debug Functions


The Wxutil.h header file in the DirectShow base classes provides functions to make deadlocks easier to track. It is useful to insert an assertion in the code that says whether a critical section is owned or not. The routines that do the checking are global functions to avoid having different numbers of member functions in the debug and retail class implementations of CCritSec. In addition, Wxutil.h provides a routine that enables you to trace usage of specific critical sections. Because of the large number of critical sections, this assertion defaults to off.
Name Description
CritCheckIn Checks that the current thread is the owner of the given critical section.
CritCheckOut Checks that the current thread is not the owner of the given critical section.
DbgLockTrace Enables or disables debug logging of a given critical section.


CritCheckIn

CCritSec Debug Functions

Checks that the owner of pcCrit is the current thread.

BOOL WINAPI CritCheckIn(
  CCritSec * pcCrit
  );

Parameters
pcCrit
Pointer to a CCritSec critical section.
Return Values

Returns TRUE if the current thread is the owner of this critical section, or FALSE otherwise.

Remarks

If you call this function when DEBUG is not defined and you've included the DirectShow headers, it will always return TRUE.


CritCheckOut

CCritSec Debug Functions

Checks that the owner of pcCrit is not the current thread.

BOOL WINAPI CritCheckOut(
  CCritSec * pcCrit
  );

Parameters
pcCrit
Pointer to a CCritSec critical section.
Return Values

Returns TRUE if the current thread is not the owner of this critical section, or FALSE otherwise.

Remarks

If you call this function when DEBUG is not defined and you've included the DirectShow headers, it will always return TRUE.


DbgLockTrace

CCritSec Debug Functions

Enables or disables debug logging of a given critical section.

void WINAPI DbgLockTrace(
  CCritSec * pcCrit,
  BOOL fTrace
  );

Parameters
pcCrit
Pointer to a CCritSec critical section.
fTrace
Set to TRUE to enable logging or FALSE to disable it.
Return Values

No return value.

Remarks

This function does nothing unless DEBUG is defined when the DirectShow headers are included.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page