greenplumn CAutoTraceFlag 源码
greenplumn CAutoTraceFlag 代码
文件路径:/src/backend/gporca/libgpos/src/task/CAutoTraceFlag.cpp
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2011 EMC Corp.
//
// @filename:
// CAutoTraceFlag.cpp
//
// @doc:
// Auto object to toggle TF in scope
//---------------------------------------------------------------------------
#include "gpos/task/CAutoTraceFlag.h"
#include "gpos/base.h"
#include "gpos/error/CAutoTrace.h"
using namespace gpos;
//---------------------------------------------------------------------------
// @function:
// CAutoTraceFlag::CAutoTraceFlag
//
// @doc:
// ctor
//
//---------------------------------------------------------------------------
CAutoTraceFlag::CAutoTraceFlag(ULONG trace, BOOL orig)
: m_trace(trace), m_orig(false)
{
GPOS_ASSERT(nullptr != ITask::Self());
m_orig = ITask::Self()->SetTrace(m_trace, orig);
}
//---------------------------------------------------------------------------
// @function:
// CAutoTraceFlag::~CAutoTraceFlag
//
// @doc:
// dtor
//
//---------------------------------------------------------------------------
CAutoTraceFlag::~CAutoTraceFlag()
{
GPOS_ASSERT(nullptr != ITask::Self());
// reset original value
ITask::Self()->SetTrace(m_trace, m_orig);
}
// EOF
相关信息
相关文章
greenplumn CAutoSuspendAbort 源码
greenplumn CTaskLocalStorage 源码
greenplumn CTaskSchedulerFifo 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦