MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_cached_segment()

std::optional< RegionCache > MayaFlux::Kakshya::RegionCacheManager::get_cached_segment ( const RegionSegment segment)

Definition at line 74 of file RegionCacheManager.cpp.

75{
76 if (!m_initialized) {
77 return std::nullopt;
78 }
79 try {
80 std::unique_lock<std::recursive_mutex> lock(m_mutex, std::try_to_lock);
81
82 if (!lock.owns_lock()) {
83 std::cerr << "Warning: Could not acquire mutex lock in get_cached_segment, potential deadlock avoided" << '\n';
84 return std::nullopt;
85 }
86
87 return get_cached_region_internal(segment.source_region);
88 } catch (const std::exception& e) {
89 std::cerr << "Exception in get_cached_segment: " << e.what() << '\n';
90 return std::nullopt;
91 } catch (...) {
92 std::cerr << "Unknown exception in get_cached_segment" << '\n';
93 return std::nullopt;
94 }
95}
std::optional< RegionCache > get_cached_region_internal(const Region &region)

References get_cached_region_internal(), m_initialized, m_mutex, and MayaFlux::Kakshya::RegionSegment::source_region.

+ Here is the call graph for this function: