Skip to content

Instantly share code, notes, and snippets.

View RockfordWei's full-sized avatar

Rockford Wei RockfordWei

View GitHub Profile
@RockfordWei
RockfordWei / demo.swift
Created August 22, 2017 14:55
How to reuse Perfect Swift MySQL connection threaded safely.
import MySQL
import PerfectThread
#if os(Linux)
import Glibc
#else
import Darwin
#endif
let mysql = MySQL()
let lock = Threading.Lock()