From fd62379eafde6571f126df5650b80cfda9f74229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 14 Nov 2019 04:16:57 +0100 Subject: refactor: per-worker resource table (#3306) - removes global `RESOURCE_TABLE` - resource tables are now created per `Worker` in `State` - renames `CliResource` to `StreamResource` and moves all logic related to it to `cli/ops/io.rs` - removes `cli/resources.rs` - adds `state` argument to `op_read` and `op_write` and consequently adds `stateful_minimal_op` to `State` - IMPORTANT NOTE: workers don't have access to process stdio - this is caused by fact that dropping worker would close stdout for process (because it's constructed from raw handle, which closes underlying file descriptor on drop) --- core/resources.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/resources.rs') diff --git a/core/resources.rs b/core/resources.rs index da4fb6b07..216f5c8df 100644 --- a/core/resources.rs +++ b/core/resources.rs @@ -65,7 +65,7 @@ impl ResourceTable { } // close(2) is done by dropping the value. Therefore we just need to remove - // the resource from the RESOURCE_TABLE. + // the resource from the resource table. pub fn close(&mut self, rid: ResourceId) -> Option<()> { self.map.remove(&rid).map(|(_name, _resource)| ()) } -- cgit v1.2.3