File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -112,13 +112,20 @@ impl GlobalInstance {
112
112
/// Should only be used in testing code.
113
113
#[ cfg( debug_assertions) ]
114
114
pub fn drop_testing ( thread_name : & str ) {
115
+ use std:: thread;
116
+
115
117
match GLOBAL . wait ( ) {
116
118
Singleton :: Production ( _) => {
117
119
unreachable ! ( "drop_testing should never be called on production global" )
118
120
}
119
121
Singleton :: Testing ( c) => {
120
- let mut guard = c. lock ( ) ;
121
- let _ = guard. remove ( thread_name) ;
122
+ let v = {
123
+ let mut guard = c. lock ( ) ;
124
+ guard. remove ( thread_name)
125
+ } ;
126
+ // We don't care about if about this container any more, just
127
+ // move to another thread to make sure this call returned ASAP.
128
+ thread:: spawn ( move || v) ;
122
129
}
123
130
}
124
131
}
You can’t perform that action at this time.
0 commit comments