mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
chan: Lock PartBundle while binding animation
This seems like the right thing to do that could prevent some potential race conditions; let me known if this is breaking anything.
This commit is contained in:
parent
480226a97a
commit
c980643649
@ -599,6 +599,10 @@ do_bind_anim(AnimControl *control, AnimBundle *anim,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Grabbing the lock early prevents any other thread in stage 0 from also
|
||||||
|
// trying to modify the channel list at the same time.
|
||||||
|
CDLockedReader cdata(_cycler);
|
||||||
|
|
||||||
plist<int> holes;
|
plist<int> holes;
|
||||||
int channel_index = 0;
|
int channel_index = 0;
|
||||||
pick_channel_index(holes, channel_index);
|
pick_channel_index(holes, channel_index);
|
||||||
@ -616,7 +620,6 @@ do_bind_anim(AnimControl *control, AnimBundle *anim,
|
|||||||
subset.is_include_empty(), bound_joints, subset);
|
subset.is_include_empty(), bound_joints, subset);
|
||||||
control->setup_anim(this, anim, channel_index, bound_joints);
|
control->setup_anim(this, anim, channel_index, bound_joints);
|
||||||
|
|
||||||
CDReader cdata(_cycler);
|
|
||||||
determine_effective_channels(cdata);
|
determine_effective_channels(cdata);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user