Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit cc29863

Browse files
committed
Ensure that TaskSource::poll() is only called from a thread that owns the main context
1 parent d2390fb commit cc29863

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main_context_futures.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ impl TaskSource {
212212
from_glib_none(glib_ffi::g_source_get_context(mut_override(source)))
213213
};
214214

215+
assert!(executor.is_owner(), "Polling futures only allowed if the thread is owning the MainContext");
216+
215217
// Clone that we store in the task local data so that
216218
// it can be retrieved as needed
217219
executor.push_thread_default();

0 commit comments

Comments
 (0)