Simple Lock

This package provides a simple locking abstraction for inter-process/thread synchronization.

It also provides a number of common implementations for locking (File Locks, POSIX Semaphores, etc).

The trait is also generic with the ability to customize the failure scenarios based on use-case.

Features:

By default, no features will be enabled and only the Lock trait and utility functionality will be available.

Un-implemented mechanisms:

Examples:

```rust use simplelock::{ // The lock interface. Lock,

// Based on the "feature" enabled, this will create the default lock.
default_lock,

// Ease of use function to lock a critical closure.
lock_until_finished,

// Result/Error types for stack-traces etc.
SimpleLockResult,

};

fn main() -> SimpleLockResult<()> { // Will return an Error if no lock type was enabled. let lock: Lock = defaultlock("myapp_name")?;

let result = lock_until_finished(
    lock,
    || {
        /// Some critical code.
    })?;
// ... Do something with the result.

} ```

If you wanted to implement your own lock, you can implement the Lock trait and use it with all the same utility functionality provided by this package. If you do not enable any features, this package is only the trait and utility functions.

Caveats:

If you are ok with the below, then go ahead and use this package.