optimize CPU cycle

Signed-off-by: yangqilin <yangqilin5@huawei.com>
This commit is contained in:
yangqilin 2024-10-08 15:05:10 +08:00
parent f42ee5b50a
commit 72917f6b68
3 changed files with 3 additions and 4 deletions

View File

@ -22,10 +22,9 @@
#include "hook.h"
namespace OHOS {
struct ThreadPrivateData {
ThreadPrivateData() : error(EGL_SUCCESS), ctx(nullptr), table(nullptr) {}
ThreadPrivateData() : error(EGL_SUCCESS), ctx(nullptr) {}
EGLint error;
EGLContext ctx;
GlHookTable *table;
};
class ThreadPrivateDataCtl {

View File

@ -40,7 +40,7 @@ Func GetEglApi(const char* procname)
return nullptr;
}
static GetGlHookTableFunc g_pfnGetGlHookTable = GetEglApi<GetGlHookTableFunc>("GetHookTable");
static GetGlHookTableKeyFunc g_pfnGetGlHookTableKey = GetEglApi<GetGlHookTableFunc>("GetHookTableKey");
static GetGlHookTableKeyFunc g_pfnGetGlHookTableKey = GetEglApi<GetGlHookTableKeyFunc>("GetHookTableKey");
static pthread_key_t g_glHookTableKey = -1;

View File

@ -29,7 +29,7 @@ void ThreadPrivateDataCtl::KeyInit()
return;
}
if (pthread_key_create(&tableKey_, nullptr) != 0) {
WLOGE("Failed to creat thread key.");
WLOGE("Failed to create thread key.");
return;
}
WLOGD("pthread_key_create. key = %{public}d", key_);