First iteration of denali server
This commit is contained in:
parent
82b1a5c4db
commit
ffa2d97a64
18 changed files with 273 additions and 39 deletions
|
|
@ -3,8 +3,10 @@
|
|||
#include "capability/capability.h"
|
||||
#include "include/zerrors.h"
|
||||
#include "lib/linked_list.h"
|
||||
#include "lib/mutex.h"
|
||||
#include "lib/pair.h"
|
||||
#include "lib/ref_ptr.h"
|
||||
#include "lib/shared_ptr.h"
|
||||
#include "object/kernel_object.h"
|
||||
#include "usr/zcall_internal.h"
|
||||
|
||||
|
|
@ -22,16 +24,21 @@ class Channel : public KernelObject {
|
|||
// circular dependency.
|
||||
RefPtr<Channel> peer_{nullptr};
|
||||
|
||||
Mutex mutex_{"channel"};
|
||||
|
||||
struct Message {
|
||||
uint64_t type;
|
||||
|
||||
uint64_t num_bytes;
|
||||
uint8_t* bytes;
|
||||
|
||||
LinkedList<RefPtr<Capability>> caps;
|
||||
};
|
||||
|
||||
// FIXME: This is probably dangerous because of an
|
||||
// implicit shallow copy.
|
||||
LinkedList<Message> pending_messages_;
|
||||
LinkedList<SharedPtr<Message>> pending_messages_;
|
||||
LinkedList<RefPtr<Thread>> blocked_threads_;
|
||||
|
||||
friend class MakeRefCountedFriend<Channel>;
|
||||
Channel() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue