MCPcopy Create free account
hub / github.com/dds-bridge/dds / Release

Method Release

library/src/system/thread_mgr.cpp:96–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94
95
96bool ThreadMgr::Release(const int machineId)
97{
98 mtx.lock();
99
100 bool ret;
101 const unsigned m = static_cast<unsigned>(machineId);
102 const int r = machineThreads[m];
103 const unsigned ru = static_cast<unsigned>(r);
104
105 if (r == -1)
106 {
107 // Error: Not in use.
108 ret = false;
109 }
110 else if (! realThreads[ru])
111 {
112 // Error: Refers to a real thread that is not in use.
113 ret = false;
114 }
115 else
116 {
117 realThreads[ru] = false;
118 machineThreads[m] = -1;
119 ret = true;
120 }
121
122 mtx.unlock();
123 return ret;
124}
125
126
127void ThreadMgr::Print(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected