polachok / fahrenheit

toy futures executor 🚒📖🔥
Other
233 stars 23 forks source link

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

Open npuichigo opened 2 years ago

npuichigo commented 2 years ago

https://github.com/polachok/fahrenheit/blob/3f2f13399f37efb4aef1d645ac874ffd13c9a7e1/src/lib.rs#L24

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 commented 1 year ago

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