Waits for membership in the thread-pool. If the thread-pool is full (it has 32 members) this blocks.
(&'static self)
| 784 | scheduler.schedule(job_ref, worker); |
| 785 | } |
| 786 | } |
| 787 | |
| 788 | /// Runs the job in a `&'static JobStorage<T>`, then releases its claim. |
| 789 | /// |
| 790 | /// # Safety |
| 791 | /// |
| 792 | /// `this` must point to a `JobStorage<T>` that lives for `'static`, whose claim |
| 793 | /// the caller holds and passes to this call. |
| 794 | unsafe fn execute_job_storage<T: Job>(this: NonNull<()>, worker: &Worker) { |
| 795 | // SAFETY: Per the safety contract, `this` points to a live `JobStorage<T>`. |
| 796 | let storage = unsafe { this.cast::<JobStorage<T>>().as_ref() }; |
| 797 | // SAFETY: We hold the claim, and this is its only run. |
| 798 | let result = unsafe { storage.run_claimed(|job| job.run(worker)) }; |
| 799 | // SAFETY: We hold the claim, and do not use the job after this. |
no test coverage detected