Skip to content

Instantly share code, notes, and snippets.

View wenchi's full-sized avatar

wenchi wenchi

View GitHub Profile
@wenchi
wenchi / SerialDispatchQueue.swift
Last active November 1, 2025 08:36
BlogSampleCode
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
// 建立一個 Serial Queue
let queue = DispatchQueue(label: "com.example.myqueue")
let blk0: @Sendable () -> Void = {
print("blk0 start"); Thread.sleep(forTimeInterval: 2); print("blk0 end")