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

Function moduleTryAcquireGIL

src/module.cpp:5986–6002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5984}
5985
5986int moduleTryAcquireGIL(bool fServerThread, int fExclusive) {
5987 if (FModuleCallBackLock(fServerThread)) {
5988 return 0;
5989 }
5990
5991 if (fServerThread)
5992 {
5993 if (!s_moduleGIL.tryAcquireRead())
5994 return 1;
5995 }
5996 else
5997 {
5998 if (!s_moduleGIL.tryAcquireWrite(fExclusive))
5999 return 1;
6000 }
6001 return 0;
6002}
6003
6004void moduleReleaseGIL(int fServerThread, int fExclusive) {
6005 if (FModuleCallBackLock(fServerThread)) {

Callers 1

Calls 3

FModuleCallBackLockFunction · 0.85
tryAcquireReadMethod · 0.80
tryAcquireWriteMethod · 0.80

Tested by

no test coverage detected