<div dir="ltr">Hello,<br><div>I have been trying to get the pointer to the control block of a thread using the _Thread_Get() function for stack sharing using a shared-memory object, the implementation can be seen <a href="https://github.com/ur10/rtems/blob/Final_release/cpukit/posix/src/shmopen.c#L103">here</a>. The problem is when I use an operation to release/acquire a critical resource I get the fatal error "INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT". I suspect this is because the interrupts are disabled during object lookup and remain disabled if an object is found( although why it would cause the above error, that escapes me).</div><div>Can someone please point out how should I use _Thread_Get() for my desired operation?</div></div>