This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Check Mailbox_Handle for NULL



Hello,

I am instantiating Mailboxes and Tasks in runtime. Some Mailbox_handles are saved in the other part of the code for further use but in some certain conditions these Mailboxes are destroyed. When Mailbox_pend is called on a saved handle that points to a destroyed Mailbox_Handle my code is blocked forever (BIOS_WAIT_FOREVER option). 

My question is how can I check the mailbox handle is valid? I mean points to a living mailbox instance.

Thank you very much for your reply,

  • Daniel Vamos said:
    My question is how can I check the mailbox handle is valid? I mean points to a living mailbox instance.

    I don't think there's any way to check for that.  The Mailbox handle belongs to your app and needs to be managed accordingly.  SYS/BIOS is designed to be a "lean-and-mean" kernel, and doesn't contain any validity checks on passed handles, nor does it contain a function to check the validity of a handle.  The overhead of that sort of check is passed on to the application.  You will need to synchronize the Mailbox destroyer with other parts of the code that use a handle.

    Regards,

    - Rob

  • Hello,

    Thank you for your reply. I am a bit sad about that, but I will handle it.

    Cheers,