@@ -38,7 +38,7 @@ mod lock {
3838 IMP_LOCK . lock ( ) ;
3939 }
4040
41- #[ cfg( all ( unix , feature = "host_env" ) ) ]
41+ #[ cfg( feature = "fork" ) ]
4242 pub ( super ) fn release_lock_after_fork_parent ( ) {
4343 if IMP_LOCK . is_locked ( ) && IMP_LOCK . is_owned_by_current_thread ( ) {
4444 unsafe { IMP_LOCK . unlock ( ) } ;
@@ -54,7 +54,7 @@ mod lock {
5454 /// # Safety
5555 ///
5656 /// Must only be called from single-threaded child after fork().
57- #[ cfg( all ( unix , feature = "host_env" ) ) ]
57+ #[ cfg( feature = "fork" ) ]
5858 pub ( crate ) unsafe fn reinit_after_fork ( ) {
5959 if IMP_LOCK . is_locked ( ) && !IMP_LOCK . is_owned_by_current_thread ( ) {
6060 // Held by a dead thread — reset to unlocked.
@@ -66,7 +66,7 @@ mod lock {
6666 /// behavior in the post-fork child:
6767 /// 1) if ownership metadata is stale (dead owner / changed tid), reset;
6868 /// 2) if current thread owns the lock, release it.
69- #[ cfg( all ( unix , feature = "host_env" ) ) ]
69+ #[ cfg( feature = "fork" ) ]
7070 pub ( super ) unsafe fn after_fork_child_reinit_and_release ( ) {
7171 unsafe { reinit_after_fork ( ) } ;
7272 if IMP_LOCK . is_locked ( ) && IMP_LOCK . is_owned_by_current_thread ( ) {
@@ -76,22 +76,22 @@ mod lock {
7676}
7777
7878/// Re-export for fork safety code in posix.rs
79- #[ cfg( all ( unix , feature = "threading" , feature = "host_env" ) ) ]
79+ #[ cfg( feature = "fork" ) ]
8080pub ( crate ) fn acquire_imp_lock_for_fork ( ) {
8181 lock:: acquire_lock_for_fork ( ) ;
8282}
8383
84- #[ cfg( all ( unix , feature = "threading" , feature = "host_env" ) ) ]
84+ #[ cfg( feature = "fork" ) ]
8585pub ( crate ) fn release_imp_lock_after_fork_parent ( ) {
8686 lock:: release_lock_after_fork_parent ( ) ;
8787}
8888
89- #[ cfg( all ( unix , feature = "threading" , feature = "host_env" ) ) ]
89+ #[ cfg( feature = "fork" ) ]
9090pub ( crate ) unsafe fn reinit_imp_lock_after_fork ( ) {
9191 unsafe { lock:: reinit_after_fork ( ) }
9292}
9393
94- #[ cfg( all ( unix , feature = "threading" , feature = "host_env" ) ) ]
94+ #[ cfg( feature = "fork" ) ]
9595pub ( crate ) unsafe fn after_fork_child_imp_lock_release ( ) {
9696 unsafe { lock:: after_fork_child_reinit_and_release ( ) }
9797}
0 commit comments