mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
fix crash in SIMPLE_THREADS case
This commit is contained in:
parent
6960d34edc
commit
d700bf85ab
@ -1088,12 +1088,14 @@ deactivate_hook(Thread *thread) {
|
|||||||
// during the SIMPLE_THREADS case, so a mutex isn't necessary; and
|
// during the SIMPLE_THREADS case, so a mutex isn't necessary; and
|
||||||
// because we are called during a context switch, so a mutex might
|
// because we are called during a context switch, so a mutex might
|
||||||
// be dangerous.
|
// be dangerous.
|
||||||
|
if (_impl == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
InternalThread *ithread = get_thread_ptr(thread->get_pstats_index());
|
InternalThread *ithread = get_thread_ptr(thread->get_pstats_index());
|
||||||
|
|
||||||
if (ithread->_thread_active) {
|
if (ithread->_thread_active) {
|
||||||
// Stop all of the active collectors for this thread.
|
// Stop all of the active collectors for this thread.
|
||||||
double now = get_real_time();
|
double now = _impl->get_real_time();
|
||||||
int off_bit = -1;
|
int off_bit = -1;
|
||||||
int on_bit = ithread->_active_collectors.get_lowest_on_bit();
|
int on_bit = ithread->_active_collectors.get_lowest_on_bit();
|
||||||
while (off_bit != on_bit) {
|
while (off_bit != on_bit) {
|
||||||
@ -1128,12 +1130,15 @@ activate_hook(Thread *thread) {
|
|||||||
// during the SIMPLE_THREADS case, so a mutex isn't necessary; and
|
// during the SIMPLE_THREADS case, so a mutex isn't necessary; and
|
||||||
// because we are called during a context switch, so a mutex might
|
// because we are called during a context switch, so a mutex might
|
||||||
// be dangerous.
|
// be dangerous.
|
||||||
|
if (_impl == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
InternalThread *ithread = get_thread_ptr(thread->get_pstats_index());
|
InternalThread *ithread = get_thread_ptr(thread->get_pstats_index());
|
||||||
|
|
||||||
if (!ithread->_thread_active) {
|
if (!ithread->_thread_active) {
|
||||||
// Resume all of the active collectors for this thread.
|
// Resume all of the active collectors for this thread.
|
||||||
double now = get_real_time();
|
double now = _impl->get_real_time();
|
||||||
int off_bit = -1;
|
int off_bit = -1;
|
||||||
int on_bit = ithread->_active_collectors.get_lowest_on_bit();
|
int on_bit = ithread->_active_collectors.get_lowest_on_bit();
|
||||||
while (off_bit != on_bit) {
|
while (off_bit != on_bit) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user