Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why we need a RC here for thread-local static variable? #24

Open
npuichigo opened this issue Sep 4, 2022 · 1 comment
Open

Why we need a RC here for thread-local static variable? #24

npuichigo opened this issue Sep 4, 2022 · 1 comment

Comments

@npuichigo
Copy link

static REACTOR: Rc<EventLoop> = Rc::new(EventLoop::new());

I'm a newbie of Rust and kindly ask why we still need a rc here. For lifetime, it's 'static and is safe to use. For shared ownership, we can still have multiple immutable reference to it.

@hieunguyent12
Copy link

Have you ever figured it out? I am wondering the same thing.

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

No branches or pull requests

2 participants