Waits for membership in the thread-pool. If the thread-pool is full (it has 32 members) this blocks.
(&'static self)
| 784 | where |
| 785 | S: Spawn<M> + Send, |
| 786 | S::Output: Send, |
| 787 | { |
| 788 | let member_data = self.get_member_data(); |
| 789 | let scheduler = move |job_ref, _: Option<&Worker>| { |
| 790 | member_data.broadcasts[member_index].push(job_ref); |
| 791 | member_data.semaphores[member_index].signal(); |
| 792 | }; |
| 793 | // SAFETY: `Spawn::spawn`'s contract requires that `!Send` work is only |
| 794 | // scheduled to run on this thread. The work is `Send` here, so this is |
| 795 | // vacuous. |
| 796 | unsafe { work.spawn(scheduler, None) } |
| 797 | } |
| 798 | |
| 799 | /// Blocks the thread waiting for a future to complete. |
no test coverage detected