MCPcopy Create free account
hub / github.com/SSheldon/rust-dispatch / barrier_async

Method barrier_async

src/queue.rs:267–273  ·  view source on GitHub ↗

Submits a closure to be executed on self as a barrier and returns immediately. Barriers create synchronization points within a concurrent queue. If self is concurrent, when it encounters a barrier it delays execution of the closure (and any further ones) until all closures submitted before the barrier finish executing. At that point, the barrier closure executes by itself. Upon completion, self r

(&self, work: F)

Source from the content-addressed store, hash-verified

265 /// If self is a serial queue or one of the global concurrent queues,
266 /// this method behaves like the normal `async` method.
267 pub fn barrier_async<F>(&self, work: F)
268 where F: 'static + Send + FnOnce() {
269 let (context, work) = context_and_function(work);
270 unsafe {
271 dispatch_barrier_async_f(self.ptr, context, work);
272 }
273 }
274
275 /// Suspends the invocation of blocks on self and returns a `SuspendGuard`
276 /// that can be dropped to resume.

Callers 1

test_barrier_asyncFunction · 0.80

Calls 1

context_and_functionFunction · 0.85

Tested by 1

test_barrier_asyncFunction · 0.64