Skip to content

Commit

Permalink
make the crate no-std (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Jul 10, 2020
1 parent 90a6824 commit 9f3ba4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -3,7 +3,7 @@ name = "try-lock"
version = "0.2.2" # remember to update html_root_url
description = "A lightweight atomic lock."
keywords = ["lock", "atomic"]
categories = ["concurrency"]
categories = ["concurrency", "no-std"]
authors = ["Sean McArthur <sean@seanmonstar.com>"]
license = "MIT"
repository = "https://github.com/seanmonstar/try-lock"
Expand Down
12 changes: 8 additions & 4 deletions src/lib.rs
Expand Up @@ -2,6 +2,7 @@
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
#![deny(warnings)]
#![cfg_attr(not(test), no_std)]

//! A light-weight lock guarded by an atomic boolean.
//!
Expand Down Expand Up @@ -43,10 +44,13 @@
//! assert_eq!(locked2.name, "Spanner Bundle");
//! ```

use std::cell::UnsafeCell;
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::sync::atomic::{AtomicBool, Ordering};
#[cfg(test)]
extern crate core;

use core::cell::UnsafeCell;
use core::fmt;
use core::ops::{Deref, DerefMut};
use core::sync::atomic::{AtomicBool, Ordering};

/// A light-weight lock guarded by an atomic boolean.
///
Expand Down

0 comments on commit 9f3ba4e

Please sign in to comment.