| 128 | } |
| 129 | |
| 130 | XN_C_API XnStatus xnProfilingInit(XnUInt32 nProfilingInterval) |
| 131 | { |
| 132 | XnStatus nRetVal = XN_STATUS_OK; |
| 133 | |
| 134 | if (nProfilingInterval == 0) |
| 135 | { |
| 136 | xnProfilingShutdown(); |
| 137 | } |
| 138 | else if (!g_ProfilingData.bInitialized) |
| 139 | { |
| 140 | g_ProfilingData.nMaxSectionName = 0; |
| 141 | g_ProfilingData.nSectionCount = 0; |
| 142 | g_ProfilingData.nProfilingInterval = nProfilingInterval; |
| 143 | g_ProfilingData.bKillThread = FALSE; |
| 144 | |
| 145 | XN_VALIDATE_CALLOC(g_ProfilingData.aSections, XnProfiledSection, MAX_PROFILED_SECTIONS); |
| 146 | g_ProfilingData.nSectionCount = 0; |
| 147 | |
| 148 | nRetVal = xnOSCreateThread(xnProfilingThread, (XN_THREAD_PARAM)NULL, &g_ProfilingData.hThread); |
| 149 | XN_IS_STATUS_OK(nRetVal); |
| 150 | |
| 151 | nRetVal = xnOSCreateCriticalSection(&g_ProfilingData.hCriticalSection); |
| 152 | XN_IS_STATUS_OK(nRetVal); |
| 153 | |
| 154 | g_ProfilingData.bInitialized = TRUE; |
| 155 | } |
| 156 | |
| 157 | return XN_STATUS_OK; |
| 158 | } |
| 159 | |
| 160 | XN_C_API XnStatus xnProfilingInitFromINI(const XnChar* cpINIFileName, const XnChar* cpSectionName) |
| 161 | { |
no test coverage detected