MCPcopy Create free account
hub / github.com/NthTensor/Forte / enroll

Method enroll

src/thread_pool.rs:786–796  ·  view source on GitHub ↗

Waits for membership in the thread-pool. If the thread-pool is full (it has 32 members) this blocks.

(&'static self)

Source from the content-addressed store, hash-verified

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.
794unsafe 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.

Callers 1

with_worker_coldMethod · 0.80

Calls 1

try_enrollMethod · 0.80

Tested by

no test coverage detected