mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Warning fixes and cleanups when building with SIMPLE_THREADS
This commit is contained in:
parent
0c9c698d13
commit
88b0f3327d
@ -445,7 +445,7 @@ do_flush() {
|
|||||||
if (data_sent > 0) {
|
if (data_sent > 0) {
|
||||||
total_sent += data_sent;
|
total_sent += data_sent;
|
||||||
}
|
}
|
||||||
double last_report = 0;
|
|
||||||
while (!okflag && tcp->Active() &&
|
while (!okflag && tcp->Active() &&
|
||||||
(data_sent > 0 || tcp->GetLastError() == LOCAL_BLOCKING_ERROR)) {
|
(data_sent > 0 || tcp->GetLastError() == LOCAL_BLOCKING_ERROR)) {
|
||||||
if (data_sent == 0) {
|
if (data_sent == 0) {
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
/* Filename: contextSwitch_longjmp_src.c
|
/**
|
||||||
* Created by: drose (15Apr10)
|
|
||||||
*
|
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
||||||
*
|
|
||||||
* PANDA 3D SOFTWARE
|
* PANDA 3D SOFTWARE
|
||||||
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -10,7 +6,10 @@
|
|||||||
* license. You should have received a copy of this license along
|
* license. You should have received a copy of this license along
|
||||||
* with this source code in a file named "LICENSE."
|
* with this source code in a file named "LICENSE."
|
||||||
*
|
*
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* @file contextSwitch_longjmp_src.c
|
||||||
|
* @author drose
|
||||||
|
* @date 2010-04-15
|
||||||
|
*/
|
||||||
|
|
||||||
/* This is the implementation of user-space context switching using
|
/* This is the implementation of user-space context switching using
|
||||||
setmp() / longjmp(). This is the hackier implementation,
|
setmp() / longjmp(). This is the hackier implementation,
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
/* Filename: contextSwitch_posix_src.c
|
/**
|
||||||
* Created by: drose (15Apr10)
|
|
||||||
*
|
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
||||||
*
|
|
||||||
* PANDA 3D SOFTWARE
|
* PANDA 3D SOFTWARE
|
||||||
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -10,7 +6,10 @@
|
|||||||
* license. You should have received a copy of this license along
|
* license. You should have received a copy of this license along
|
||||||
* with this source code in a file named "LICENSE."
|
* with this source code in a file named "LICENSE."
|
||||||
*
|
*
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* @file contextSwitch_posix_src.c
|
||||||
|
* @author drose
|
||||||
|
* @date 2010-04-15
|
||||||
|
*/
|
||||||
|
|
||||||
/* This is the implementation of user-space context switching using
|
/* This is the implementation of user-space context switching using
|
||||||
posix threads to manage the different execution contexts. This
|
posix threads to manage the different execution contexts. This
|
||||||
@ -164,7 +163,7 @@ alloc_thread_context() {
|
|||||||
pthread_mutexattr_init(&attr);
|
pthread_mutexattr_init(&attr);
|
||||||
// The symbol PTHREAD_MUTEX_DEFAULT isn't always available?
|
// The symbol PTHREAD_MUTEX_DEFAULT isn't always available?
|
||||||
// pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT);
|
// pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT);
|
||||||
int result = pthread_mutex_init(&context->_ready_mutex, &attr);
|
pthread_mutex_init(&context->_ready_mutex, &attr);
|
||||||
pthread_mutexattr_destroy(&attr);
|
pthread_mutexattr_destroy(&attr);
|
||||||
|
|
||||||
pthread_cond_init(&context->_ready_cvar, NULL);
|
pthread_cond_init(&context->_ready_cvar, NULL);
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
/* Filename: contextSwitch_ucontext_src.c
|
/**
|
||||||
* Created by: drose (15Apr10)
|
|
||||||
*
|
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
||||||
*
|
|
||||||
* PANDA 3D SOFTWARE
|
* PANDA 3D SOFTWARE
|
||||||
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -10,7 +6,10 @@
|
|||||||
* license. You should have received a copy of this license along
|
* license. You should have received a copy of this license along
|
||||||
* with this source code in a file named "LICENSE."
|
* with this source code in a file named "LICENSE."
|
||||||
*
|
*
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* @file contextSwitch_ucontext_src.c
|
||||||
|
* @author drose
|
||||||
|
* @date 2010-04-15
|
||||||
|
*/
|
||||||
|
|
||||||
/* This is the implementation of user-space context switching using
|
/* This is the implementation of user-space context switching using
|
||||||
getcontext() / setcontext(). This is the preferred implementation,
|
getcontext() / setcontext(). This is the preferred implementation,
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
/* Filename: contextSwitch_windows_src.c
|
/**
|
||||||
* Created by: drose (15Apr10)
|
|
||||||
*
|
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
||||||
*
|
|
||||||
* PANDA 3D SOFTWARE
|
* PANDA 3D SOFTWARE
|
||||||
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -10,7 +6,10 @@
|
|||||||
* license. You should have received a copy of this license along
|
* license. You should have received a copy of this license along
|
||||||
* with this source code in a file named "LICENSE."
|
* with this source code in a file named "LICENSE."
|
||||||
*
|
*
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* @file contextSwitch_windows_src.c
|
||||||
|
* @author drose
|
||||||
|
* @date 2010-04-15
|
||||||
|
*/
|
||||||
|
|
||||||
/* This is the implementation of user-space context switching using
|
/* This is the implementation of user-space context switching using
|
||||||
native Windows threading constructs to manage the different
|
native Windows threading constructs to manage the different
|
||||||
|
@ -225,7 +225,7 @@ call_python_func(PyObject *function, PyObject *args) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// No exception. Restore the thread state normally.
|
// No exception. Restore the thread state normally.
|
||||||
PyThreadState *state = PyThreadState_Swap(orig_thread_state);
|
PyThreadState_Swap(orig_thread_state);
|
||||||
thread_states.push_back(new_thread_state);
|
thread_states.push_back(new_thread_state);
|
||||||
// PyThreadState_Clear(new_thread_state);
|
// PyThreadState_Clear(new_thread_state);
|
||||||
// PyThreadState_Delete(new_thread_state);
|
// PyThreadState_Delete(new_thread_state);
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
#include "mainThread.h"
|
#include "mainThread.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user