@ -18,11 +18,11 @@
# include <grpc/support/port_platform.h>
# include <grpc/support/port_platform.h>
# include <atomic>
# include <atomic>
# include <utility>
# include "absl/status/status.h"
# include "absl/status/status.h"
# include <grpc/event_engine/event_engine.h>
# include <grpc/event_engine/event_engine.h>
# include <grpc/support/log.h>
# include "src/core/lib/gprpp/time.h"
# include "src/core/lib/gprpp/time.h"
# include "src/core/lib/promise/activity.h"
# include "src/core/lib/promise/activity.h"
@ -38,17 +38,12 @@ class Sleep final {
Sleep ( const Sleep & ) = delete ;
Sleep ( const Sleep & ) = delete ;
Sleep & operator = ( const Sleep & ) = delete ;
Sleep & operator = ( const Sleep & ) = delete ;
Sleep ( Sleep & & other ) noexcept : deadline_ ( other . deadline_ ) {
Sleep ( Sleep & & other ) noexcept
// Promises can be moved only until they're polled, and since we only create
: deadline_ ( other . deadline_ ) ,
// the closure when first polled we can assume it's nullptr here.
closure_ ( std : : exchange ( other . closure_ , nullptr ) ) { }
GPR_DEBUG_ASSERT ( other . closure_ = = nullptr ) ;
} ;
Sleep & operator = ( Sleep & & other ) noexcept {
Sleep & operator = ( Sleep & & other ) noexcept {
// Promises can be moved only until they're polled, and since we only create
// the closure when first polled we can assume it's nullptr here.
GPR_DEBUG_ASSERT ( closure_ = = nullptr ) ;
GPR_DEBUG_ASSERT ( other . closure_ = = nullptr ) ;
deadline_ = other . deadline_ ;
deadline_ = other . deadline_ ;
std : : swap ( closure_ , other . closure_ ) ;
return * this ;
return * this ;
} ;
} ;