Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Jason Yu yxztj

🎯
Focusing
Block or report user

Report or block yxztj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yxztj
yxztj / deadlock.swift
Last active Mar 22, 2019
concurrent execution with nested write lock would cause deadlock
View deadlock.swift
import UIKit
private var imp = pthread_rwlock_t()
func wlock(_ time: Int) {
pthread_rwlock_wrlock(&imp)
print("[\(time)]wlock")
}
func rlock(_ time: Int) {
@yxztj
yxztj / repro.swift
Created Jun 4, 2018
Wrong size for Chinese text
View repro.swift
import UIKit
import PlaygroundSupport
let paragraph = NSMutableParagraphStyle()
paragraph.lineSpacing = 20
// the issue won't report with PingFangSC-Regular font
//let font = UIFont(name: "PingFangSC-Regular", size: 18)!
// setting to ".SFUIText" would lead to reproductive
let font = UIFont(name: ".SFUIText", size: 18)!
You can’t perform that action at this time.