[warn] 31335#0: *1040117 [lua] _G write guard:12: writing a global lua variable ('uls') which may lead to race conditions between concurren
t requests, so prefer the use of 'local' variables
local comm = require "comm"
int KEY_HASH(lua_State* L)
{
size_t iKeyLen = 0;
const char* pKeyValue = luaL_checklstring(L,1, &iKeyLen);
int iHashBase = luaL_checknumber(L,2);
if (pKeyValue == NULL)
{
return 1;
}
unsigned long long ullKey = hash(pKeyValue,iKeyLen,iHashBase);
lua_pushnumber(L, ullKey);
return 1;
}
static luaL_Reg mylibs[] = {
{"KEY_HASH", KEY_HASH},
{NULL, NULL}
};
int luaopen_comm(lua_State* L)
{
luaL_register(L, "comm", mylibs);
return 1;
}
[warn] 31335#0: *1040117 [lua] _G write guard:12: writing a global lua variable ('comm') which may lead to race conditions between concurre
nt requests, so prefer the use of 'local' variables