Media Kit: fix use of pthread_once_init in FormatManager.cpp
Signed-off-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
8bbdad1487
commit
6242374090
@@ -129,7 +129,7 @@ FormatManager::FormatManager()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pthread_once_t FormatManager::sInitOnce;
|
pthread_once_t FormatManager::sInitOnce = PTHREAD_ONCE_INIT;
|
||||||
FormatManager* FormatManager::sInstance = NULL;
|
FormatManager* FormatManager::sInstance = NULL;
|
||||||
|
|
||||||
|
|
||||||
@@ -143,8 +143,7 @@ FormatManager::CreateInstance()
|
|||||||
/* static */ FormatManager*
|
/* static */ FormatManager*
|
||||||
FormatManager::GetInstance()
|
FormatManager::GetInstance()
|
||||||
{
|
{
|
||||||
if (sInstance == NULL)
|
pthread_once(&sInitOnce, &CreateInstance);
|
||||||
pthread_once(&sInitOnce, &CreateInstance);
|
|
||||||
|
|
||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user