[util] Add util::deque container

Adding the util::deque container, implemented with the util::linked_list
of arrays of items.

Also, use the deque for a kobject's blocked thread list to maintain
order instead of a vector using remove_swap().
This commit is contained in:
Justin C. Miller
2022-01-30 20:42:49 -08:00
parent 2aef7176ab
commit a7245116b6
4 changed files with 182 additions and 19 deletions

View File

@@ -23,6 +23,8 @@ struct handle
static_cast<j6_handle_t>(obj ? obj->get_type() : kobject::type::none) << type_shift;
}
inline handle() : id {j6_handle_invalid}, object {nullptr} {}
inline handle(j6_handle_t in_id, kobject *in_obj, j6_cap_t caps) :
id {make_id(in_id, caps, in_obj)}, object {in_obj} {
if (object) object->handle_retain();
@@ -90,6 +92,7 @@ struct handle
inline const kobject * as<kobject>() const { return object; }
j6_handle_t id;
uint64_t badge;
kobject *object;
};