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