 }
 
 // MARK: SDAtomic
+
+private let SDThreadDefaultDispatchQueue = DispatchQueue(label: "com.SusanDoggie.Thread", attributes: .concurrent)
 
 open class SDAtomic {
     


public class SDSpinLock {
    
    fileprivate var base: Bool
    fileprivate var thread_id: pthread_t?
    fileprivate var count: Int
    
    public init() {
        self.base = false
        self.thread_id = nil
        self.count = 0
    }
}

extension SDSpinLock : Lockable {
    
    public func unlock() {
        if count == 0 {
            thread_id = nil
            if !base.fetchStore(false) {
                fatalError("unlock() is called before lock()")
            }
        } else {
            count -= 1
        }
    }
    public func trylock() -> Bool {
        if base.compareSet(old: false, new: true) {
            thread_id = pthread_self()
            count = 0
            return true
        } else if pthread_equal(thread_id, pthread_self()) != 0 {
            count += 1
            return true
        }
        return false

    return lhs.value == rhs.value
}

// MARK: Lockable

public protocol Lockable : class {
