Closed
Description
Writing libraries that interface with blocking foreign code is very delicate because it's way too easy for users to call the library with a SchedMode that will wind up blocking multiple tasks. Even worse the failure mode is non-deterministic and depends on the number of tasks running and the number of cores available.
One way to alleviate this is to add some sort of get_sched_mode function to task.rs. Then the library code could assert that it is not being called with a dangerous mode.