/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace
{
+#if defined(EMSCRIPTEN)
+ThreadLocalStorage* threadLocal = NULL;
+#else
__thread ThreadLocalStorage* threadLocal = NULL;
+#endif
}
ThreadLocalStorage::ThreadLocalStorage(Core* core)
: mCore( core )
-#ifdef DYNAMICS_SUPPORT
-, mDynamicsWorldInstance( NULL )
-#endif
{
DALI_ASSERT_ALWAYS( threadLocal == NULL && "Cannot create more than one ThreadLocalStorage object" );
- // reset is used to store a new value associated with this thread
threadLocal = this;
}
void ThreadLocalStorage::Remove()
{
-#ifdef DYNAMICS_SUPPORT
- if( mDynamicsWorldInstance )
- {
- mDynamicsWorldInstance.Reset();
- }
-#endif
threadLocal = NULL;
}
return threadLocal;
}
-#ifdef DYNAMICS_SUPPORT
-Dali::Internal::DynamicsWorldPtr ThreadLocalStorage::GetDynamicsWorldInstance()
-{
- if( !mDynamicsWorldInstance )
- {
- // Create the instance if it doesn't exist.
- mDynamicsWorldInstance = DynamicsWorld::New();
- }
- return mDynamicsWorldInstance;
-}
-#endif
-
Dali::Integration::PlatformAbstraction& ThreadLocalStorage::GetPlatformAbstraction()
{
return mCore->GetPlatform();
return mCore->GetResourceClient();
}
-ImageFactory& ThreadLocalStorage::GetImageFactory()
-{
- return mCore->GetImageFactory();
-}
-
ShaderFactory& ThreadLocalStorage::GetShaderFactory()
{
return mCore->GetShaderFactory();