rust/src/rt/rust_port.h

54 lines
1.0 KiB
C
Raw Normal View History

#ifndef RUST_PORT_H
#define RUST_PORT_H
2012-02-15 00:23:16 -06:00
#include "rust_internal.h"
class port_detach_cond : public rust_cond { };
2011-07-29 13:00:44 -05:00
class rust_port : public kernel_owned<rust_port>, public rust_cond {
private:
// Protects ref_count and detach_cond
lock_and_signal ref_lock;
intptr_t ref_count;
port_detach_cond detach_cond;
public:
void ref();
void deref();
2011-07-29 13:00:44 -05:00
public:
2011-08-08 20:09:42 -05:00
rust_port_id id;
rust_kernel *kernel;
rust_task *task;
size_t unit_sz;
2011-11-11 13:46:07 -06:00
circular_buffer buffer;
lock_and_signal lock;
public:
rust_port(rust_task *task, size_t unit_sz);
~rust_port();
2010-08-09 09:52:07 -05:00
void log_state();
void send(void *sptr);
2012-03-02 02:55:27 -06:00
void receive(void *dptr, uintptr_t *yield);
size_t size();
void begin_detach(uintptr_t *yield);
void end_detach();
};
//
// Local Variables:
// mode: C++
// fill-column: 78;
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
2011-07-13 15:51:20 -05:00
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
// End:
//
#endif /* RUST_PORT_H */