- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
          Move locks to sys
          #121177
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    
  
    Move locks to sys
  
  #121177
                      Changes from all commits
      Commits
    
    
            Show all changes
          
          
            9 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      0cd21cc
              
                std: move locks to `sys` on µITRON
              
              
                joboet c2d0f84
              
                std: move locks to `sys` on SGX
              
              
                joboet 5e343e7
              
                std: move locks to `sys` on teeos
              
              
                joboet 491d1a7
              
                std: move locks to `sys` on UNIX and other futex platforms
              
              
                joboet 6ee4510
              
                std: move locks to `sys` on Windows
              
              
                joboet f77c4d5
              
                std: move locks to `sys` on xous
              
              
                joboet 21fef03
              
                std: move locks to `sys` on platforms without threads
              
              
                joboet 4ec5b98
              
                update license reference
              
              
                joboet 1b1b6dd
              
                update debuginfo test
              
              
                joboet File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            2 changes: 1 addition & 1 deletion
          
          2 
        
  ...d/src/sys/pal/unix/locks/futex_condvar.rs → library/std/src/sys/locks/condvar/futex.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            4 changes: 3 additions & 1 deletion
          
          4 
        
  library/std/src/sys/pal/itron/condvar.rs → library/std/src/sys/locks/condvar/itron.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| cfg_if::cfg_if! { | ||
| if #[cfg(any( | ||
| target_os = "linux", | ||
| target_os = "android", | ||
| target_os = "freebsd", | ||
| target_os = "openbsd", | ||
| target_os = "dragonfly", | ||
| target_os = "fuchsia", | ||
| all(target_family = "wasm", target_feature = "atomics"), | ||
| target_os = "hermit", | ||
| ))] { | ||
| mod futex; | ||
| pub use futex::Condvar; | ||
| } else if #[cfg(target_family = "unix")] { | ||
| mod pthread; | ||
| pub use pthread::Condvar; | ||
| } else if #[cfg(target_os = "windows")] { | ||
| mod windows; | ||
| pub use windows::Condvar; | ||
| } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { | ||
| mod sgx; | ||
| pub use sgx::Condvar; | ||
| } else if #[cfg(target_os = "solid_asp3")] { | ||
| mod itron; | ||
| pub use itron::Condvar; | ||
| } else if #[cfg(target_os = "teeos")] { | ||
| mod teeos; | ||
| pub use teeos::Condvar; | ||
| } else if #[cfg(target_os = "xous")] { | ||
| mod xous; | ||
| pub use xous::Condvar; | ||
| } else { | ||
| mod no_threads; | ||
| pub use no_threads::Condvar; | ||
| } | ||
| } | 
            File renamed without changes.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            3 changes: 1 addition & 2 deletions
          
          3 
        
  library/std/src/sys/pal/sgx/condvar.rs → library/std/src/sys/locks/condvar/sgx.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
            File renamed without changes.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            2 changes: 1 addition & 1 deletion
          
          2 
        
  ...ary/std/src/sys/pal/xous/locks/condvar.rs → library/std/src/sys/locks/condvar/xous.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            1 change: 1 addition & 0 deletions
          
          1 
        
  .../std/src/sys/pal/unsupported/locks/mod.rs → library/std/src/sys/locks/mod.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| mod condvar; | ||
| mod mutex; | ||
| mod rwlock; | ||
| 
     | 
||
| pub use condvar::Condvar; | ||
| pub use mutex::Mutex; | ||
| pub use rwlock::RwLock; | 
            File renamed without changes.
          
    
            File renamed without changes.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| cfg_if::cfg_if! { | ||
| if #[cfg(any( | ||
| target_os = "linux", | ||
| target_os = "android", | ||
| target_os = "freebsd", | ||
| target_os = "openbsd", | ||
| target_os = "dragonfly", | ||
| all(target_family = "wasm", target_feature = "atomics"), | ||
| target_os = "hermit", | ||
| ))] { | ||
| mod futex; | ||
| pub use futex::Mutex; | ||
| } else if #[cfg(target_os = "fuchsia")] { | ||
| mod fuchsia; | ||
| pub use fuchsia::Mutex; | ||
| } else if #[cfg(any( | ||
| target_family = "unix", | ||
| target_os = "teeos", | ||
| ))] { | ||
| mod pthread; | ||
| pub use pthread::{Mutex, raw}; | ||
| } else if #[cfg(target_os = "windows")] { | ||
| mod windows; | ||
| pub use windows::{Mutex, raw}; | ||
| } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { | ||
| mod sgx; | ||
| pub use sgx::Mutex; | ||
| } else if #[cfg(target_os = "solid_asp3")] { | ||
| mod itron; | ||
| pub use itron::Mutex; | ||
| } else if #[cfg(target_os = "xous")] { | ||
| mod xous; | ||
| pub use xous::Mutex; | ||
| } else { | ||
| mod no_threads; | ||
| pub use no_threads::Mutex; | ||
| } | ||
| } | 
            File renamed without changes.
          
    
            File renamed without changes.
          
    
        
          
          
            2 changes: 1 addition & 1 deletion
          
          2 
        
  library/std/src/sys/pal/sgx/mutex.rs → library/std/src/sys/locks/mutex/sgx.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| cfg_if::cfg_if! { | ||
| if #[cfg(any( | ||
| target_os = "linux", | ||
| target_os = "android", | ||
| target_os = "freebsd", | ||
| target_os = "openbsd", | ||
| target_os = "dragonfly", | ||
| target_os = "fuchsia", | ||
| all(target_family = "wasm", target_feature = "atomics"), | ||
| target_os = "hermit", | ||
| ))] { | ||
| mod futex; | ||
| pub use futex::RwLock; | ||
| } else if #[cfg(target_family = "unix")] { | ||
| mod queue; | ||
| pub use queue::RwLock; | ||
| } else if #[cfg(target_os = "windows")] { | ||
| mod windows; | ||
| pub use windows::RwLock; | ||
| } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { | ||
| mod sgx; | ||
| pub use sgx::RwLock; | ||
| } else if #[cfg(target_os = "solid_asp3")] { | ||
| mod solid; | ||
| pub use solid::RwLock; | ||
| } else if #[cfg(target_os = "teeos")] { | ||
| mod teeos; | ||
| pub use teeos::RwLock; | ||
| } else if #[cfg(target_os = "xous")] { | ||
| mod xous; | ||
| pub use xous::RwLock; | ||
| } else { | ||
| mod no_threads; | ||
| pub use no_threads::RwLock; | ||
| } | ||
| } | 
            File renamed without changes.
          
    
            File renamed without changes.
          
    
        
          
          
            7 changes: 3 additions & 4 deletions
          
          7 
        
  library/std/src/sys/pal/sgx/rwlock.rs → library/std/src/sys/locks/rwlock/sgx.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            2 changes: 1 addition & 1 deletion
          
          2 
        
  library/std/src/sys/pal/solid/rwlock.rs → library/std/src/sys/locks/rwlock/solid.rs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -6,6 +6,7 @@ mod pal; | |
| mod personality; | ||
| 
     | 
||
| pub mod cmath; | ||
| pub mod locks; | ||
| pub mod os_str; | ||
| pub mod path; | ||
| 
     | 
||
| 
          
            
          
           | 
    ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              This file was deleted.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.