Refactor Worker and ThreadSafeState (#3242)

* Split ThreadSafeState into State and GlobalState. State is a "local"
  state belonging to "Worker" while "GlobalState" is state shared by
  whole program.
* Update "Worker" and ops to use "GlobalState" where applicable
* Move and refactor "WorkerChannels" resource
This commit is contained in:
Bartek Iwańczuk 2019-11-04 16:38:52 +01:00 committed by Ry Dahl
parent 429439d198
commit 0049d4e50c
16 changed files with 557 additions and 414 deletions

View file

@ -52,7 +52,7 @@ impl fmt::Display for PermissionAccessorState {
}
}
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct PermissionAccessor {
state: Arc<AtomicUsize>,
}
@ -110,7 +110,7 @@ impl Default for PermissionAccessor {
}
}
#[derive(Debug, Default)]
#[derive(Clone, Debug, Default)]
pub struct DenoPermissions {
// Keep in sync with cli/js/permissions.ts
pub allow_read: PermissionAccessor,