@@ -7,12 +7,10 @@ use crate::scheduler::SchedulableSuspender;
77use crate :: { catch, error, impl_current_for, impl_display_by_debug, info} ;
88use nix:: sys:: pthread:: { pthread_kill, pthread_self, Pthread } ;
99use nix:: sys:: signal:: { sigaction, SaFlags , SigAction , SigHandler , SigSet , Signal } ;
10- use std:: any:: TypeId ;
1110use std:: cell:: { Cell , UnsafeCell } ;
1211use std:: collections:: HashSet ;
1312use std:: fmt:: Debug ;
1413use std:: io:: { Error , ErrorKind } ;
15- use std:: marker:: PhantomData ;
1614use std:: mem:: MaybeUninit ;
1715use std:: sync:: Arc ;
1816use std:: thread:: JoinHandle ;
@@ -176,35 +174,19 @@ impl Monitor {
176174impl_current_for ! ( MONITOR , Monitor ) ;
177175
178176#[ repr( C ) ]
179- #[ derive( educe:: Educe ) ]
180- #[ educe( Debug ( named_field = false ) ) ]
181- pub ( crate ) struct MonitorListener < Param , Yield , Return > (
182- PhantomData < Param > ,
183- PhantomData < Yield > ,
184- PhantomData < Return > ,
185- ) ;
186-
187- impl < Param , Yield , Return > MonitorListener < Param , Yield , Return > {
188- pub ( crate ) fn new ( ) -> Self {
189- Self ( PhantomData , PhantomData , PhantomData )
190- }
191- }
177+ #[ derive( Debug ) ]
178+ pub ( crate ) struct MonitorListener ;
192179
193180const NOTIFY_NODE : & str = "MONITOR_NODE" ;
194181
195- impl < Param : ' static , Yield : ' static , Return > Listener < Yield , Return >
196- for MonitorListener < Param , Yield , Return >
197- {
182+ impl < Yield , Return > Listener < Yield , Return > for MonitorListener {
198183 fn on_state_changed (
199184 & self ,
200185 local : & CoroutineLocal ,
201186 _: CoroutineState < Yield , Return > ,
202187 new_state : CoroutineState < Yield , Return > ,
203188 ) {
204- if TypeId :: of :: < Param > ( ) != TypeId :: of :: < ( ) > ( )
205- || TypeId :: of :: < Yield > ( ) != TypeId :: of :: < ( ) > ( )
206- || Monitor :: current ( ) . is_some ( )
207- {
189+ if Monitor :: current ( ) . is_some ( ) {
208190 return ;
209191 }
210192 match new_state {
0 commit comments