File tree Expand file tree Collapse file tree 5 files changed +10
-32
lines changed
tests/runtime-async/async/cancel-import Expand file tree Collapse file tree 5 files changed +10
-32
lines changed Original file line number Diff line number Diff line change @@ -756,7 +756,6 @@ typedef enum {snake}_waitable_state {{
756756 {shouty}_WAITABLE_CANCELLED,
757757}} {snake}_waitable_state_t;
758758
759- void {snake}_backpressure_set(bool enable);
760759void {snake}_backpressure_inc(void);
761760void {snake}_backpressure_dec(void);
762761void* {snake}_context_get(void);
@@ -823,13 +822,6 @@ void {snake}_task_cancel() {{
823822 __task_cancel();
824823}}
825824
826- __attribute__((__import_module__("$root"), __import_name__("[backpressure-set]")))
827- extern void __backpressure_set(bool enable);
828-
829- void {snake}_backpressure_set(bool enable) {{
830- __backpressure_set(enable);
831- }}
832-
833825__attribute__((__import_module__("$root"), __import_name__("[backpressure-inc]")))
834826extern void __backpressure_inc(void);
835827
Original file line number Diff line number Diff line change @@ -873,9 +873,6 @@ pub mod examples;
873873#[ doc( hidden) ]
874874pub mod rt;
875875
876- #[ cfg( feature = "async" ) ]
877- #[ allow( deprecated) ]
878- pub use rt:: async_support:: backpressure_set;
879876#[ cfg( feature = "async-spawn" ) ]
880877pub use rt:: async_support:: spawn;
881878#[ cfg( feature = "inter-task-wakeup" ) ]
Original file line number Diff line number Diff line change @@ -622,24 +622,6 @@ pub async fn yield_async() {
622622 Yield :: default ( ) . await ;
623623}
624624
625- /// Call the `backpressure.set` canonical built-in function.
626- ///
627- /// When `enabled` is `true`, this tells the host to defer any new calls to this
628- /// component instance until further notice (i.e. until `backpressure.set` is
629- /// called again with `enabled` set to `false`).
630- #[ deprecated = "use backpressure_{inc,dec} instead" ]
631- pub fn backpressure_set ( enabled : bool ) {
632- extern_wasm ! {
633- #[ link( wasm_import_module = "$root" ) ]
634- extern "C" {
635- #[ link_name = "[backpressure-set]" ]
636- fn backpressure_set( _: i32 ) ;
637- }
638- }
639-
640- unsafe { backpressure_set ( if enabled { 1 } else { 0 } ) }
641- }
642-
643625/// Call the `backpressure.inc` canonical built-in function.
644626pub fn backpressure_inc ( ) {
645627 extern_wasm ! {
Original file line number Diff line number Diff line change @@ -50,5 +50,9 @@ test_callback_code_t exports_test_pending_import_callback(test_event_t *event) {
5050}
5151
5252void exports_test_backpressure_set (bool x ) {
53- test_backpressure_set (x );
53+ if (x ) {
54+ test_backpressure_inc ();
55+ } else {
56+ test_backpressure_dec ();
57+ }
5458}
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ impl crate::exports::my::test::i::Guest for Component {
1212 }
1313
1414 fn backpressure_set ( x : bool ) {
15- #[ expect( deprecated) ]
16- return wit_bindgen:: backpressure_set ( x) ;
15+ if x {
16+ wit_bindgen:: backpressure_inc ( ) ;
17+ } else {
18+ wit_bindgen:: backpressure_dec ( ) ;
19+ }
1720 }
1821}
You can’t perform that action at this time.
0 commit comments