fix(client): turn Rc into Arc

This commit is contained in:
Nova
2022-06-14 21:02:05 -04:00
parent 3421fa84af
commit 46a1581e1b
6 changed files with 33 additions and 37 deletions

View File

@@ -6,7 +6,7 @@ use mio::unix::pipe;
use mio::{Events, Interest, Poll, Token};
use slab::Slab;
use std::io::Write;
use std::rc::Rc;
use std::sync::Arc;
use std::thread::{self, JoinHandle};
pub struct EventLoop {
@@ -24,7 +24,7 @@ impl EventLoop {
let join_handle = thread::Builder::new()
.name("event_loop".to_owned())
.spawn(move || -> Result<()> {
let mut clients: Slab<Option<Rc<Client>>> = Slab::new();
let mut clients: Slab<Option<Arc<Client>>> = Slab::new();
let mut poll = Poll::new()?;
let mut events = Events::with_capacity(1024);
const LISTENER: Token = Token(usize::MAX - 1);