| // Copyright 2026 The Fuchsia Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| //! This file is not generated by bindgen because it doesn't really make sense to use bindgen | |
| //! to generate two function signatures that are unlikely to change. | |
| //! | |
| //! The original definitions are in //sdk/lib/async-default/include/lib/async | |
| use crate::async_dispatcher_t; | |
| unsafe extern "C" { | |
| // SAFETY: This API is safe to call at any time. | |
| /// Gets the currently active async dispatcher for the current thread, if set. | |
| pub safe fn async_get_default_dispatcher() -> *const async_dispatcher_t; | |
| /// Sets the current thread's default asynchronous dispatcher interface. | |
| /// May be set to |NULL| if this thread doesn't have a default dispatcher. | |
| /// | |
| /// # Safety | |
| /// | |
| /// The caller must ensure that the dispatcher being passed in is currently | |
| /// valid, and that it will remain valid until either the current thread has | |
| /// exited or it has been replaced with another dispatcher (including NULL). | |
| pub unsafe fn async_set_default_dispatcher(dispatcher: *const async_dispatcher_t); | |
| } |