@@ -134,10 +134,10 @@ namespace pmon::ipc
134134 :
135135 shm_{ bip::open_only, sharedMemoryName.value_or (defaultSegmentName_).c_str () }
136136 {}
137- const PM_INTROSPECTION_ROOT* GetIntrospectionRoot () override
137+ const PM_INTROSPECTION_ROOT* GetIntrospectionRoot (uint32_t timeoutMs ) override
138138 {
139139 // make sure holdoff semaphore has been released
140- WaitOnIntrospectionHoldoff_ ();
140+ WaitOnIntrospectionHoldoff_ (timeoutMs );
141141 // acquire shared lock on introspection data
142142 auto sharedLock = LockIntrospectionMutexForShare_ ();
143143 // find the introspection structure in shared memory
@@ -157,7 +157,7 @@ namespace pmon::ipc
157157 }
158158 private:
159159 // functions
160- void WaitOnIntrospectionHoldoff_ ()
160+ void WaitOnIntrospectionHoldoff_ (uint32_t timeoutMs )
161161 {
162162 using namespace std ::chrono_literals;
163163 using clock = std::chrono::high_resolution_clock;
@@ -167,7 +167,7 @@ namespace pmon::ipc
167167 }
168168 auto & sem = *result.first ;
169169 // wait for holdoff to be released (timeout after XXXms)
170- if (!sem.timed_wait (clock::now () + 750ms )) {
170+ if (!sem.timed_wait (clock::now () + 1ms * timeoutMs )) {
171171 throw std::runtime_error{ " timeout accessing introspection" };
172172 }
173173 // return the slot we just took because holdoff should not limit entry once released
0 commit comments