Remove wrong 'unsafe impl Send' for ClassState
Instead, make ClassState Send by making all its members Send. This means
that the 'checker' callback now has to be Send and Sync and is saved in
an Arc instead of Rc.
use std::convert::From;
use std::default::Default;
-use std::rc::Rc;
+use std::sync::Arc;
use rlua::{self, Lua, ToLua, Table, Value, UserData, AnyUserData, Function,
UserDataMethods, MetaMethod};
use super::object::{self, Object};
use super::property::Property;
-pub type Checker = Rc<Fn(Object) -> bool>;
+pub type Checker = Arc<Fn(Object) -> bool + Send + Sync>;
#[derive(Clone, Debug)]
pub struct Class<'lua> {
@@ -30,8 +30,6 @@ pub struct ClassState {
instances: u32
}
-unsafe impl Send for ClassState {}
-
pub struct ClassBuilder<'lua>{
lua: &'lua Lua,
class: Class<'lua>
