MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / RegsterSessionId

Function RegsterSessionId

oneflow/core/framework/session_util.cpp:47–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47bool RegsterSessionId(int64_t session_id) {
48 std::unique_lock<std::mutex> lock(*GlobalSessionUtilMutex());
49 auto* regsitered_ids = RegsiteredSessionIds();
50 auto itor = std::find(regsitered_ids->begin(), regsitered_ids->end(), session_id);
51 if (itor != regsitered_ids->end()) { return false; }
52 regsitered_ids->push_back(session_id);
53 return true;
54}
55
56bool ClearSessionId(int64_t session_id) {
57 std::unique_lock<std::mutex> lock(*GlobalSessionUtilMutex());

Callers 1

OneFlowEnvMethod · 0.85

Calls 5

GlobalSessionUtilMutexFunction · 0.85
RegsiteredSessionIdsFunction · 0.85
push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected