# set_synchronization_context

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-system/threading/function-set_synchronization_context/

**function** · [`ferroui-system`](/docs/0.5.0/api/ferroui-system/) · v0.5.0

```rust
fn set_synchronization_context(context: Option<std::sync::Arc<dyn SynchronizationContext>>)
```

Sets the current context of the calling thread (`SynchronizationContext.SetSynchronizationContext`).
An adapter of it ([`context_schedule`](/docs/0.5.0/api/ferroui-system/threading/function-context_schedule/)) becomes the schedule of the thread, through which other
threads wake its tasks and run its cancellations, and the current schedule of the thread, which
the tasks spawned here and the reactive libraries take; `None` clears all three.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.System/threading/synchronization_context.rs#L90)

> **Deprecated since 0.5.0.** a dispatcher is the schedule of its thread and of its jobs; elsewhere use `ferroui_system::task::set_thread_schedule` and `set_current_schedule`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
