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 {
112112 /// Should only be used in testing code.
113113 #[ cfg( debug_assertions) ]
114114 pub fn drop_testing ( thread_name : & str ) {
115+ use std:: thread;
116+
115117 match GLOBAL . wait ( ) {
116118 Singleton :: Production ( _) => {
117119 unreachable ! ( "drop_testing should never be called on production global" )
118120 }
119121 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) ;
122129 }
123130 }
124131 }
You can’t perform that action at this time.
0 commit comments