[ RCOS.java Home | RCOS Home | David's Home ]

MailBox CRC

Name:

MailBoxHeader

Comment:

The following class defines a single mailbox, or temporary storage for messages. Incoming messages are put by the PostOffice into the appropriate mailbox, and these messages can then be retrieved by threads on this machine.

Collaborators:

Responsibilities:

class MailBox {
  public:
    MailBox();                  // Allocate and initialize mail box
    ~MailBox();                 // De-allocate mail box

    void Put(PacketHeader pktHdr, MailHeader mailHdr, char *data);
                                // Atomically put a message into the mailbox
    void Get(PacketHeader *pktHdr, MailHeader *mailHdr, char *data);
                                // Atomically get a message out of the
                                // mailbox (and wait if there is no message
                                // to get!)
  private:
    SynchList *messages;        // A mailbox is just a list of arrived messages
};