More removal of RwLocks and replace it with Atomics, to prevent locks.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-06-18 14:17:29 +02:00
parent 59d7344729
commit c45c7538bf
15 changed files with 293 additions and 192 deletions

View File

@@ -63,7 +63,7 @@ pub struct ExecutingMove<'own, 'battle, 'library> {
number_of_hits: u8,
hits: Vec<HitData>,
user: Arc<RwLock<Pokemon<'battle, 'library>>>,
chosen_move: Arc<RwLock<LearnedMove<'library>>>,
chosen_move: Arc<LearnedMove<'library>>,
use_move: &'own MoveData,
script: ScriptContainer,
targets: &'own TargetList<'battle, 'library>,
@@ -75,7 +75,7 @@ impl<'own, 'battle, 'library> ExecutingMove<'own, 'battle, 'library> {
targets: &'own TargetList<'battle, 'library>,
number_of_hits: u8,
user: Arc<RwLock<Pokemon<'battle, 'library>>>,
chosen_move: Arc<RwLock<LearnedMove<'library>>>,
chosen_move: Arc<LearnedMove<'library>>,
use_move: &'own MoveData,
script: ScriptContainer,
) -> Self {
@@ -104,7 +104,7 @@ impl<'own, 'battle, 'library> ExecutingMove<'own, 'battle, 'library> {
pub fn user(&self) -> &Arc<RwLock<Pokemon<'battle, 'library>>> {
&self.user
}
pub fn chosen_move(&self) -> &Arc<RwLock<LearnedMove<'library>>> {
pub fn chosen_move(&self) -> &Arc<LearnedMove<'library>> {
&self.chosen_move
}