Welcome, Guest. Please login or register.

Author Topic: ReplyMsg() not working  (Read 3888 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline FluffyMcDeath

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 3440
    • Show all replies
Re: ReplyMsg() not working
« on: March 16, 2003, 08:41:48 AM »
Well, I can't answer your question but ...

Quote

jahc wrote:

NOW.. heres task b which runs at the same time..

int ng_config_main()
{

struct SM_Message
{    struct Message xym_Msg;
   char           SM_info[50];
   } *ss3_msg, *ss2_msg;

    struct MsgPort *SlapshotNBX_replyport = FindPort("SlapshotNBX_replyport");
    struct MsgPort *SlapshotNBX_port=FindPort("SlapshotNBX_port");



Task b should create and own the reply port rather than having task a create and own it. If task a goes away, your reply port goes away too. Holding a pointer to the port doen't guarantee that it will exist. Generally, pointers to message ports can only be considered valid after Forbid, then FindPort, upto Permit, so you shouldn't hold onto a pointer to another tasks message port.

Hmmmm. Perhaps task b never gets a signal because the port was created in the context of task a. Perhaps a, being the owner, gets the signal.