Skip to content

Instantly share code, notes, and snippets.

View einsteinx2's full-sized avatar

Ben Baron einsteinx2

View GitHub Profile
@einsteinx2
einsteinx2 / locking.swift
Last active March 2, 2019 17:25 — forked from kristopherjohnson/locking.swift
Simple synchronization functions for Swift, wrapping the Cocoa NSLocking classes
import Foundation
/// Protocol for NSLocking objects that also provide try()
public protocol TryLockable: NSLocking {
func `try`() -> Bool
}
// These Cocoa classes have tryLock()
extension NSLock: TryLockable {}
extension NSRecursiveLock: TryLockable {}
Hey that's great! Here's a super quick overview to get you started, but if you have some time later, I can give you a more in depth walkthrough over a google hangout.
While it's coded in C#, we're targeting the Mono 3 runtime, not necessarily .NET. For all intents and purposes, these are the same, but we do occasionally use some Mono additions (like dllmaps for different platforms).
Basically the project it split into 2 assemblies: Core and Server.
Core contains the data model and basically any logic that isn't specific to the actual server part (i.e. could also be used in a client).
This is: