MCPcopy Create free account
hub / github.com/catboost/catboost / TryAcquire

Method TryAcquire

util/system/file_lock.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32bool TFileLock::TryAcquire() {
33 try {
34 Flock(GetMode(Type) | LOCK_NB);
35 return true;
36 } catch (const TSystemError& e) {
37 if (e.Status() != EWOULDBLOCK) {
38 throw;
39 }
40 return false;
41 }
42}
43
44void TFileLock::Release() {
45 Flock(LOCK_UN);

Callers

nothing calls this directly

Calls 3

GetModeFunction · 0.85
FlockFunction · 0.70
StatusMethod · 0.45

Tested by

no test coverage detected