pub fn receive(&mut self) -> M
    {
        let q = unsafe { self.q.as_mut().bk_unwrap() };

        loop {
            if q.msg_cnt.cnt() > 0 {
                break;
            }

            Minimult::wait(&q.msg_cnt, MTEventCond::GreaterThan(0));
        }

        let curr_rd_idx = q.rd_idx;
        let next_rd_idx = wrap_inc(curr_rd_idx, q.mem.len());

        let msg = q.mem.read_volatile(curr_rd_idx);

        q.rd_idx = next_rd_idx; // NOTE: volatile access might be necessary

        q.msg_cnt.decr();
        Minimult::signal(&q.msg_cnt);

        msg
    }
/// Receives a message.
/// * Returns the received message.
/// * Blocks if there is no available message entry.

Receives a message.
Returns the received message.
Blocks if there is no available message entry.
Receives a message . Returns the received message . Blocks if there is no available message entry .
pub fn receive(&mut self) -> M
    {
        let q = unsafe { self.q.as_mut().bk_unwrap() };
        loop {
            if q.msg_cnt.cnt() > 0 {
                break;
            }
            Minimult::wait(&q.msg_cnt, MTEventCond::GreaterThan(0));
        }
        let curr_rd_idx = q.rd_idx;
        let next_rd_idx = wrap_inc(curr_rd_idx, q.mem.len());
        let msg = q.mem.read_volatile(curr_rd_idx);
        q.rd_idx = next_rd_idx; // NOTE: volatile access might be necessary
        q.msg_cnt.decr();
        Minimult::signal(&q.msg_cnt);
        msg
    }
pub fn receive ( & mut self ) -> M { let q = unsafe { self . q . as_mut ( ) . bk_unwrap ( ) } ; loop { if q . msg_cnt . cnt ( ) > 0 { break ; } Minimult :: wait ( & q . msg_cnt , MTEventCond :: GreaterThan ( 0 ) ) ; } let curr_rd_idx = q . rd_idx ; let next_rd_idx = wrap_inc ( curr_rd_idx , q . mem . len ( ) ) ; let msg = q . mem . read_volatile ( curr_rd_idx ) ; q . rd_idx = next_rd_idx ; // NOTE: volatile access might be necessary
 q . msg_cnt . decr ( ) ; Minimult :: signal ( & q . msg_cnt ) ; msg }
Receives a message.
Receives a message .
&mut self
&mut self