diff --git a/src/runtime2/runtime.rs b/src/runtime2/runtime.rs index 155dcd51e8311df571e18a31cb85c81134a37887..d8ea8d5960331c5e15062ebc667a7840f6991bfe 100644 --- a/src/runtime2/runtime.rs +++ b/src/runtime2/runtime.rs @@ -273,33 +273,6 @@ impl RuntimeInner { return (CompKey(index), component); } - /// Creates a new component. Note that the public part will be properly - /// initialized, but not all private fields are. - pub(crate) fn create_pdl_component(&self, comp: CompPDL, ctx: CompCtx, initially_sleeping: bool) -> (CompKey, &mut RuntimeComp) { - let inbox_queue = QueueDynMpsc::new(16); - let inbox_producer = inbox_queue.producer(); - let comp = RuntimeComp{ - public: CompPublic{ - sleeping: AtomicBool::new(initially_sleeping), - num_handles: AtomicU32::new(1), // the component itself acts like a handle - inbox: inbox_producer, - }, - code: comp, - ctx, - inbox: inbox_queue, - exiting: false, - }; - - let index = self.components.create(comp); - - // TODO: just do a reserve_index followed by a consume_index or something - self.increment_active_components(); - let component = self.components.get_mut(index); - component.ctx.id = CompId(index); - - return (CompKey(index), component); - } - pub(crate) fn get_component(&self, key: CompKey) -> &mut RuntimeComp { let component = self.components.get_mut(key.0); return component;