11//! Safe bindings for [`AMidiDevice`], [`AMidiInputPort`], and [`AMidiOutputPort`]
22//!
33//! Provides implementation of `SafeMidiDeviceBox` that ensures the current thread is attached to
4- //! the Java VM when being dropped, which is required by [`AMidiDevice_release`]. All other types
5- //! of this module holds an [`Arc`] of `SafeMidiDeviceBox`.
4+ //! the Java VM when being dropped, which is required by [`ffi:: AMidiDevice_release() `]. All other
5+ //! types of this module holds an [`Arc`] of `SafeMidiDeviceBox`.
66//!
7- //! Note that all other functions except for [`AMidiDevice_fromJava`] and [`AMidiDevice_release`]
8- //! are safe to be called in any thread without the calling thread attached to the Java VM.
7+ //! Note that all other functions except for [`ffi::AMidiDevice_fromJava()`] and
8+ //! [`ffi::AMidiDevice_release()`] are safe to be called in any thread without the calling thread
9+ //! attached to the Java VM.
910//!
1011//! [`AMidiDevice`]: https://developer.android.com/ndk/reference/group/midi#amididevice
11- //! [`AMidiDevice_release`]: https://developer.android.com/ndk/reference/group/midi#amididevice_release
1212//! [`AMidiInputPort`]: https://developer.android.com/ndk/reference/group/midi#amidiinputport
1313//! [`AMidiOutputPort`]: https://developer.android.com/ndk/reference/group/midi#amidioutputport
1414
@@ -27,16 +27,16 @@ use super::*;
2727/// [`MidiDevice`] is not dropped while the safe wrappers are alive.
2828///
2929/// [`SafeMidiDeviceBox`] also holds a pointer to the current Java VM to attach the calling thread
30- /// of [`Drop ::drop`] to the VM, which is required by [`ffi::AMidiDevice_release`].
30+ /// of [`SafeMidiDeviceBox ::drop() `] to the VM, which is required by [`ffi::AMidiDevice_release() `].
3131struct SafeMidiDeviceBox {
3232 midi_device : ManuallyDrop < MidiDevice > ,
3333 java_vm : NonNull < jni_sys:: JavaVM > ,
3434}
3535
36- // SAFETY: [`SafeMidiDeviceBox::drop`] attaches the calling thread to the Java VM if required.
36+ // SAFETY: [`SafeMidiDeviceBox::drop() `] attaches the calling thread to the Java VM if required.
3737unsafe impl Send for SafeMidiDeviceBox { }
3838
39- // SAFETY: [`SafeMidiDeviceBox::drop`] attaches the calling thread to the Java VM if required.
39+ // SAFETY: [`SafeMidiDeviceBox::drop() `] attaches the calling thread to the Java VM if required.
4040unsafe impl Sync for SafeMidiDeviceBox { }
4141
4242impl Drop for SafeMidiDeviceBox {
@@ -239,6 +239,6 @@ impl Deref for SafeMidiOutputPort {
239239unsafe impl Send for SafeMidiOutputPort { }
240240
241241// SAFETY: AMidiOutputPort is guarded by a atomic state ([`AMIDI_Port::state`]), which enables
242- // [`ffi::AMidiOutputPort_receive`] to detect accesses from multiple threads and return error.
242+ // [`ffi::AMidiOutputPort_receive() `] to detect accesses from multiple threads and return error.
243243// https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/media/native/midi/amidi.cpp?q=symbol%3A%5CbMidiReceiver%3A%3Areceive%5Cb%20case%3Ayes
244244unsafe impl Sync for SafeMidiOutputPort { }
0 commit comments