@@ -283,7 +283,7 @@ pub unsafe extern "C" fn iox2_waitset_capacity(handle: iox2_waitset_h_ref) -> c_
283
283
}
284
284
}
285
285
286
- /// Stops the current [`iox2_waitset_wait ()`] operation. Any [`iox2_waitset_wait ()`]
286
+ /// Stops the current [`iox2_waitset_wait_and_process_events ()`] operation. Any [`iox2_waitset_wait_and_process_events ()`]
287
287
/// call after this call is not affected and the user needs to call
288
288
/// [`iox2_waitset_stop()`] again.
289
289
///
@@ -305,7 +305,7 @@ pub unsafe extern "C" fn iox2_waitset_stop(handle: iox2_waitset_h_ref) {
305
305
306
306
/// Attaches a provided [`iox2_file_descriptor_ptr`] as notification to the
307
307
/// [`iox2_waitset_h`]. As soon as the attachment receives data, the WaitSet
308
- /// wakes up in [`iox2_waitset_wait ()`] and informs the user.
308
+ /// wakes up in [`iox2_waitset_wait_and_process_events ()`] and informs the user.
309
309
///
310
310
/// With [`iox2_waitset_attachment_id_has_event_from()`](crate::iox2_waitset_attachment_id_has_event_from())
311
311
/// the origin of the event can be determined from its corresponding
@@ -381,7 +381,7 @@ pub unsafe extern "C" fn iox2_waitset_attach_notification(
381
381
382
382
/// Attaches a provided [`iox2_file_descriptor_ptr`] as deadline to the
383
383
/// [`iox2_waitset_h`]. As soon as the attachment receives data or the deadline
384
- /// was missed, the WaitSet wakes up in [`iox2_waitset_wait ()`] and informs the user.
384
+ /// was missed, the WaitSet wakes up in [`iox2_waitset_wait_and_process_events ()`] and informs the user.
385
385
///
386
386
/// With [`iox2_waitset_attachment_id_has_event_from()`](crate::iox2_waitset_attachment_id_has_event_from())
387
387
/// the origin of the event can be determined from its corresponding
@@ -469,7 +469,7 @@ pub unsafe extern "C" fn iox2_waitset_attach_deadline(
469
469
}
470
470
471
471
/// Attaches an interval to the [`iox2_waitset_h`]. As soon as the interval has passed
472
- /// the WaitSet wakes up in [`iox2_waitset_wait ()`] and informs the user.
472
+ /// the WaitSet wakes up in [`iox2_waitset_wait_and_process_events ()`] and informs the user.
473
473
///
474
474
/// With [`iox2_waitset_attachment_id_has_event_from()`](crate::iox2_waitset_attachment_id_has_event_from())
475
475
/// the origin of the event can be determined from its corresponding
@@ -568,7 +568,7 @@ pub unsafe extern "C" fn iox2_waitset_attach_interval(
568
568
/// * the provided [`iox2_waitset_attachment_id_h`] in the callback must be released via
569
569
/// [`iox2_waitset_attachment_id_drop()`](crate::iox2_waitset_attachment_id_drop())
570
570
#[ no_mangle]
571
- pub unsafe extern "C" fn iox2_waitset_try_wait (
571
+ pub unsafe extern "C" fn iox2_waitset_try_wait_and_process_events (
572
572
handle : iox2_waitset_h_ref ,
573
573
callback : iox2_waitset_run_callback ,
574
574
callback_ctx : iox2_callback_context ,
@@ -578,26 +578,38 @@ pub unsafe extern "C" fn iox2_waitset_try_wait(
578
578
let waitset = & mut * handle. as_type ( ) ;
579
579
580
580
let run_once_result = match waitset. service_type {
581
- iox2_service_type_e:: IPC => waitset. value . as_ref ( ) . ipc . try_wait ( |attachment_id| {
582
- let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
583
- ( * attachment_id_ptr) . init (
584
- waitset. service_type ,
585
- AttachmentIdUnion :: new_ipc ( attachment_id) ,
586
- iox2_waitset_attachment_id_t:: dealloc,
587
- ) ;
588
- let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
589
- callback ( attachment_id_handle_ptr, callback_ctx) ;
590
- } ) ,
591
- iox2_service_type_e:: LOCAL => waitset. value . as_ref ( ) . local . try_wait ( |attachment_id| {
592
- let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
593
- ( * attachment_id_ptr) . init (
594
- waitset. service_type ,
595
- AttachmentIdUnion :: new_local ( attachment_id) ,
596
- iox2_waitset_attachment_id_t:: dealloc,
597
- ) ;
598
- let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
599
- callback ( attachment_id_handle_ptr, callback_ctx) ;
600
- } ) ,
581
+ iox2_service_type_e:: IPC => {
582
+ waitset
583
+ . value
584
+ . as_ref ( )
585
+ . ipc
586
+ . try_wait_and_process_events ( |attachment_id| {
587
+ let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
588
+ ( * attachment_id_ptr) . init (
589
+ waitset. service_type ,
590
+ AttachmentIdUnion :: new_ipc ( attachment_id) ,
591
+ iox2_waitset_attachment_id_t:: dealloc,
592
+ ) ;
593
+ let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
594
+ callback ( attachment_id_handle_ptr, callback_ctx) ;
595
+ } )
596
+ }
597
+ iox2_service_type_e:: LOCAL => {
598
+ waitset
599
+ . value
600
+ . as_ref ( )
601
+ . local
602
+ . try_wait_and_process_events ( |attachment_id| {
603
+ let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
604
+ ( * attachment_id_ptr) . init (
605
+ waitset. service_type ,
606
+ AttachmentIdUnion :: new_local ( attachment_id) ,
607
+ iox2_waitset_attachment_id_t:: dealloc,
608
+ ) ;
609
+ let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
610
+ callback ( attachment_id_handle_ptr, callback_ctx) ;
611
+ } )
612
+ }
601
613
} ;
602
614
603
615
match run_once_result {
@@ -631,7 +643,7 @@ pub unsafe extern "C" fn iox2_waitset_try_wait(
631
643
/// * the provided [`iox2_waitset_attachment_id_h`] in the callback must be released via
632
644
/// [`iox2_waitset_attachment_id_drop()`](crate::iox2_waitset_attachment_id_drop())
633
645
#[ no_mangle]
634
- pub unsafe extern "C" fn iox2_waitset_wait (
646
+ pub unsafe extern "C" fn iox2_waitset_wait_and_process_events (
635
647
handle : iox2_waitset_h_ref ,
636
648
callback : iox2_waitset_run_callback ,
637
649
callback_ctx : iox2_callback_context ,
@@ -643,26 +655,38 @@ pub unsafe extern "C" fn iox2_waitset_wait(
643
655
let waitset = & mut * handle. as_type ( ) ;
644
656
645
657
let run_result = match waitset. service_type {
646
- iox2_service_type_e:: IPC => waitset. value . as_ref ( ) . ipc . wait ( |attachment_id| {
647
- let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
648
- ( * attachment_id_ptr) . init (
649
- waitset. service_type ,
650
- AttachmentIdUnion :: new_ipc ( attachment_id) ,
651
- iox2_waitset_attachment_id_t:: dealloc,
652
- ) ;
653
- let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
654
- callback ( attachment_id_handle_ptr, callback_ctx) ;
655
- } ) ,
656
- iox2_service_type_e:: LOCAL => waitset. value . as_ref ( ) . local . wait ( |attachment_id| {
657
- let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
658
- ( * attachment_id_ptr) . init (
659
- waitset. service_type ,
660
- AttachmentIdUnion :: new_local ( attachment_id) ,
661
- iox2_waitset_attachment_id_t:: dealloc,
662
- ) ;
663
- let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
664
- callback ( attachment_id_handle_ptr, callback_ctx) ;
665
- } ) ,
658
+ iox2_service_type_e:: IPC => {
659
+ waitset
660
+ . value
661
+ . as_ref ( )
662
+ . ipc
663
+ . wait_and_process_events ( |attachment_id| {
664
+ let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
665
+ ( * attachment_id_ptr) . init (
666
+ waitset. service_type ,
667
+ AttachmentIdUnion :: new_ipc ( attachment_id) ,
668
+ iox2_waitset_attachment_id_t:: dealloc,
669
+ ) ;
670
+ let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
671
+ callback ( attachment_id_handle_ptr, callback_ctx) ;
672
+ } )
673
+ }
674
+ iox2_service_type_e:: LOCAL => {
675
+ waitset
676
+ . value
677
+ . as_ref ( )
678
+ . local
679
+ . wait_and_process_events ( |attachment_id| {
680
+ let attachment_id_ptr = iox2_waitset_attachment_id_t:: alloc ( ) ;
681
+ ( * attachment_id_ptr) . init (
682
+ waitset. service_type ,
683
+ AttachmentIdUnion :: new_local ( attachment_id) ,
684
+ iox2_waitset_attachment_id_t:: dealloc,
685
+ ) ;
686
+ let attachment_id_handle_ptr = ( * attachment_id_ptr) . as_handle ( ) ;
687
+ callback ( attachment_id_handle_ptr, callback_ctx) ;
688
+ } )
689
+ }
666
690
} ;
667
691
668
692
match run_result {
0 commit comments