Skip to content

change DYNAMIC_THREAD_COUNT to be an AtomicUsize#451

Closed
kolapapa wants to merge 9 commits into
async-rs:masterfrom
kolapapa:DYNAMIC_THREAD_COUNT-with-AtomicUsize
Closed

change DYNAMIC_THREAD_COUNT to be an AtomicUsize#451
kolapapa wants to merge 9 commits into
async-rs:masterfrom
kolapapa:DYNAMIC_THREAD_COUNT-with-AtomicUsize

Conversation

@kolapapa

@kolapapa kolapapa commented Nov 4, 2019

Copy link
Copy Markdown

Comment thread src/task/task_id.rs Outdated
/// Generates a new `TaskId`.
pub(crate) fn generate() -> TaskId {
static COUNTER: AtomicU64 = AtomicU64::new(1);
static COUNTER: AtomicUsize = AtomicUsize::new(1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should still be an AtomicU64, I'm afraid. What we can do is use AtomicCell<u64> from crossbeam-utils.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed it as you suggest

@kolapapa

kolapapa commented Nov 8, 2019

Copy link
Copy Markdown
Author

#286 Is this PR ready to merge? Then I'll close this~It looks better

@yoshuawuyts

Copy link
Copy Markdown
Contributor

@kolapapa it seems this PR has merge conflicts with master. Could this perhaps be rebased? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants