diff --git a/src/libos/src/fs/inode_file.rs b/src/libos/src/fs/inode_file.rs index 65303a79..d61ebf4a 100644 --- a/src/libos/src/fs/inode_file.rs +++ b/src/libos/src/fs/inode_file.rs @@ -6,7 +6,7 @@ pub struct INodeFile { abs_path: String, offset: SgxMutex, access_mode: AccessMode, - status_flags: SgxRwLock, + status_flags: RwLock, } impl File for INodeFile { @@ -216,7 +216,7 @@ impl INodeFile { abs_path: abs_path.to_owned(), offset: SgxMutex::new(0), access_mode, - status_flags: SgxRwLock::new(status_flags), + status_flags: RwLock::new(status_flags), }) } diff --git a/src/libos/src/fs/pipe.rs b/src/libos/src/fs/pipe.rs index 520a39da..7cf1f212 100644 --- a/src/libos/src/fs/pipe.rs +++ b/src/libos/src/fs/pipe.rs @@ -21,11 +21,11 @@ impl Pipe { Ok(Pipe { reader: PipeReader { inner: SgxMutex::new(ring_buf.reader), - status_flags: SgxRwLock::new(valid_flags), + status_flags: RwLock::new(valid_flags), }, writer: PipeWriter { inner: SgxMutex::new(ring_buf.writer), - status_flags: SgxRwLock::new(valid_flags), + status_flags: RwLock::new(valid_flags), }, }) } @@ -34,7 +34,7 @@ impl Pipe { #[derive(Debug)] pub struct PipeReader { inner: SgxMutex, - status_flags: SgxRwLock, + status_flags: RwLock, } impl File for PipeReader { @@ -95,7 +95,7 @@ unsafe impl Sync for PipeReader {} #[derive(Debug)] pub struct PipeWriter { inner: SgxMutex, - status_flags: SgxRwLock, + status_flags: RwLock, } impl File for PipeWriter { diff --git a/src/libos/src/process/process/builder.rs b/src/libos/src/process/process/builder.rs index 23ff162a..e2f69f88 100644 --- a/src/libos/src/process/process/builder.rs +++ b/src/libos/src/process/process/builder.rs @@ -97,9 +97,9 @@ impl ProcessBuilder { // Build a new process let new_process = { let exec_path = self.exec_path.take().unwrap_or_default(); - let parent = self.parent.take().map(|parent| SgxRwLock::new(parent)); + let parent = self.parent.take().map(|parent| RwLock::new(parent)); let inner = SgxMutex::new(ProcessInner::new()); - let sig_dispositions = SgxRwLock::new(SigDispositions::new()); + let sig_dispositions = RwLock::new(SigDispositions::new()); let sig_queues = RwLock::new(SigQueues::new()); let forced_exit_status = ForcedExitStatus::new(); Arc::new(Process { diff --git a/src/libos/src/process/process/mod.rs b/src/libos/src/process/process/mod.rs index 46bf94a1..0a267d69 100644 --- a/src/libos/src/process/process/mod.rs +++ b/src/libos/src/process/process/mod.rs @@ -16,10 +16,10 @@ pub struct Process { pid: pid_t, exec_path: String, // Mutable info - parent: Option>, + parent: Option>, inner: SgxMutex, // Signal - sig_dispositions: SgxRwLock, + sig_dispositions: RwLock, sig_queues: RwLock, forced_exit_status: ForcedExitStatus, } @@ -105,7 +105,7 @@ impl Process { } /// Get the process-wide signal dispositions. - pub fn sig_dispositions(&self) -> &SgxRwLock { + pub fn sig_dispositions(&self) -> &RwLock { &self.sig_dispositions } diff --git a/src/libos/src/process/thread/builder.rs b/src/libos/src/process/thread/builder.rs index a10ddc29..90544687 100644 --- a/src/libos/src/process/thread/builder.rs +++ b/src/libos/src/process/thread/builder.rs @@ -94,7 +94,7 @@ impl ThreadBuilder { .task .ok_or_else(|| errno!(EINVAL, "task is mandatory"))?; let tid = self.tid.unwrap_or_else(|| ThreadId::new()); - let clear_ctid = SgxRwLock::new(self.clear_ctid); + let clear_ctid = RwLock::new(self.clear_ctid); let inner = SgxMutex::new(ThreadInner::new()); let process = self .process @@ -106,10 +106,10 @@ impl ThreadBuilder { let files = self.files.unwrap_or_default(); let sched = self.sched.unwrap_or_default(); let rlimits = self.rlimits.unwrap_or_default(); - let name = SgxRwLock::new(self.name.unwrap_or_default()); + let name = RwLock::new(self.name.unwrap_or_default()); let sig_queues = RwLock::new(SigQueues::new()); - let sig_mask = SgxRwLock::new(SigSet::new_empty()); - let sig_tmp_mask = SgxRwLock::new(SigSet::new_empty()); + let sig_mask = RwLock::new(SigSet::new_empty()); + let sig_tmp_mask = RwLock::new(SigSet::new_empty()); let sig_stack = SgxMutex::new(None); let profiler = if cfg!(feature = "syscall_timing") { SgxMutex::new(Some(ThreadProfiler::new())) diff --git a/src/libos/src/process/thread/mod.rs b/src/libos/src/process/thread/mod.rs index ee79029a..7f88c7da 100644 --- a/src/libos/src/process/thread/mod.rs +++ b/src/libos/src/process/thread/mod.rs @@ -24,9 +24,9 @@ pub struct Thread { // Immutable info tid: ThreadId, // Mutable info - clear_ctid: SgxRwLock>>, + clear_ctid: RwLock>>, inner: SgxMutex, - name: SgxRwLock, + name: RwLock, // Process process: ProcessRef, // Resources @@ -37,8 +37,8 @@ pub struct Thread { rlimits: ResourceLimitsRef, // Signal sig_queues: RwLock, - sig_mask: SgxRwLock, - sig_tmp_mask: SgxRwLock, + sig_mask: RwLock, + sig_tmp_mask: RwLock, sig_stack: SgxMutex>, // System call timing profiler: SgxMutex>, @@ -86,7 +86,7 @@ impl Thread { } /// Get the per-thread signal mask. - pub fn sig_mask(&self) -> &SgxRwLock { + pub fn sig_mask(&self) -> &RwLock { &self.sig_mask } @@ -94,7 +94,7 @@ impl Thread { /// /// The tmp mask is always cleared at the end of the execution /// of a syscall. - pub fn sig_tmp_mask(&self) -> &SgxRwLock { + pub fn sig_tmp_mask(&self) -> &RwLock { &self.sig_tmp_mask }