How to use _Thread_Get() function properly?

Utkarsh Rai utkarsh.rai60 at gmail.com
Mon Aug 31 17:52:08 UTC 2020


Hello,
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 here
<https://github.com/ur10/rtems/blob/Final_release/cpukit/posix/src/shmopen.c#L103>.
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).
Can someone please point out how should I use _Thread_Get() for my desired
operation?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200831/64e18221/attachment.html>


More information about the devel mailing list