MCPcopy Create free account
hub / github.com/ElementsProject/elements / CLockLocation

Class CLockLocation

src/sync.cpp:38–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36//
37
38struct CLockLocation {
39 CLockLocation(
40 const char* pszName,
41 const char* pszFile,
42 int nLine,
43 bool fTryIn,
44 const std::string& thread_name)
45 : fTry(fTryIn),
46 mutexName(pszName),
47 sourceFile(pszFile),
48 m_thread_name(thread_name),
49 sourceLine(nLine) {}
50
51 std::string ToString() const
52 {
53 return strprintf(
54 "'%s' in %s:%s%s (in thread '%s')",
55 mutexName, sourceFile, sourceLine, (fTry ? " (TRY)" : ""), m_thread_name);
56 }
57
58 std::string Name() const
59 {
60 return mutexName;
61 }
62
63private:
64 bool fTry;
65 std::string mutexName;
66 std::string sourceFile;
67 const std::string& m_thread_name;
68 int sourceLine;
69};
70
71using LockStackItem = std::pair<void*, CLockLocation>;
72using LockStack = std::vector<LockStackItem>;

Callers 1

EnterCriticalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected