MCPcopy Create free account
hub / github.com/cisco/openh264 / AddReference

Method AddReference

codec/common/src/WelsThreadPool.cpp:87–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86
87CWelsThreadPool* CWelsThreadPool::AddReference() {
88 CWelsAutoLock cLock (GetInitLock());
89 if (m_pThreadPoolSelf == NULL) {
90 m_pThreadPoolSelf = new CWelsThreadPool();
91 if (!m_pThreadPoolSelf) {
92 return NULL;
93 }
94 }
95
96 if (m_iRefCount == 0) {
97 if (WELS_THREAD_ERROR_OK != m_pThreadPoolSelf->Init()) {
98 m_pThreadPoolSelf->Uninit();
99 delete m_pThreadPoolSelf;
100 m_pThreadPoolSelf = NULL;
101 return NULL;
102 }
103 }
104
105 ////fprintf(stdout, "m_iRefCount=%d, iMaxThreadNum=%d\n", m_iRefCount, m_iMaxThreadNum);
106
107 ++ m_iRefCount;
108 //fprintf(stdout, "m_iRefCount2=%d\n", m_iRefCount);
109 return m_pThreadPoolSelf;
110}
111
112void CWelsThreadPool::RemoveInstance() {
113 CWelsAutoLock cLock (GetInitLock());

Callers

nothing calls this directly

Calls 2

InitMethod · 0.45
UninitMethod · 0.45

Tested by

no test coverage detected