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

Callers 1

with_worker_coldMethod · 0.80

Calls 1

try_enrollMethod · 0.80

Tested by

no test coverage detected