Closed Berrysoft closed 1 year ago
Where is the
Send
impl
In std
:)
You can see the comment of spawn_unchecked
:
If
schedule
is not [Send
] and [Sync
], all instances of the [Runnable
]'s [Waker
] must be used and dropped on the original thread.
As we cannot stop the user use and drop the waker on other threads, we should panic to make schedule Send and Sync.
Does that mean the old impl we have are unsound?
I think so.
However, simply calling
wake
in other threads may not trigger reschedule. Therefore I don't know how to construct a panic test.Closes #108 . According to the votes of the maintainers, we don't want to support futures channel working cross thread.