Skip to content

Instantly share code, notes, and snippets.

@brennanMKE
brennanMKE / Async.swift
Last active March 6, 2023 13:01
Blocking with Semaphores and DispatchGroups in Swift
import PlaygroundSupport
import Foundation
class Worker {
private let queue = DispatchQueue.global(qos: .background)
private let serialQueue = DispatchQueue(label: "com.acme.serial")
public private(set) var count = 0
func incrementCount() {