MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / FModuleCallBackLock

Function FModuleCallBackLock

src/module.cpp:5967–5970  ·  view source on GitHub ↗

A module may be triggered synchronously in a non-module context. In this scenario we don't lock again as the server thread acquisition is sufficient. If we did try to lock we would deadlock

Source from the content-addressed store, hash-verified

5965// A module may be triggered synchronously in a non-module context. In this scenario we don't lock again
5966// as the server thread acquisition is sufficient. If we did try to lock we would deadlock
5967static bool FModuleCallBackLock(bool fServerThread)
5968{
5969 return !fServerThread && aeThreadOwnsLock() && !g_fModuleThread && s_moduleGIL.hasReader();
5970}
5971void moduleAcquireGIL(int fServerThread, int fExclusive) {
5972 if (FModuleCallBackLock(fServerThread)) {
5973 return;

Callers 3

moduleAcquireGILFunction · 0.85
moduleTryAcquireGILFunction · 0.85
moduleReleaseGILFunction · 0.85

Calls 2

aeThreadOwnsLockFunction · 0.85
hasReaderMethod · 0.80

Tested by

no test coverage detected