Warning fixes and cleanups when building with SIMPLE_THREADS

This commit is contained in:
rdb 2018-10-16 21:19:06 +02:00
parent 0c9c698d13
commit 88b0f3327d
7 changed files with 43 additions and 45 deletions

View File

@ -445,7 +445,7 @@ do_flush() {
if (data_sent > 0) {
total_sent += data_sent;
}
double last_report = 0;
while (!okflag && tcp->Active() &&
(data_sent > 0 || tcp->GetLastError() == LOCAL_BLOCKING_ERROR)) {
if (data_sent == 0) {

View File

@ -1,8 +1,4 @@
/* Filename: contextSwitch_longjmp_src.c
* Created by: drose (15Apr10)
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
@ -10,7 +6,10 @@
* license. You should have received a copy of this license along
* 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
setmp() / longjmp(). This is the hackier implementation,

View File

@ -1,8 +1,4 @@
/* Filename: contextSwitch_posix_src.c
* Created by: drose (15Apr10)
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
@ -10,7 +6,10 @@
* license. You should have received a copy of this license along
* 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
posix threads to manage the different execution contexts. This
@ -164,7 +163,7 @@ alloc_thread_context() {
pthread_mutexattr_init(&attr);
// The symbol PTHREAD_MUTEX_DEFAULT isn't always available?
// 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_cond_init(&context->_ready_cvar, NULL);

View File

@ -1,8 +1,4 @@
/* Filename: contextSwitch_ucontext_src.c
* Created by: drose (15Apr10)
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
@ -10,7 +6,10 @@
* license. You should have received a copy of this license along
* 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
getcontext() / setcontext(). This is the preferred implementation,

View File

@ -1,8 +1,4 @@
/* Filename: contextSwitch_windows_src.c
* Created by: drose (15Apr10)
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
@ -10,7 +6,10 @@
* license. You should have received a copy of this license along
* 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
native Windows threading constructs to manage the different

View File

@ -225,7 +225,7 @@ call_python_func(PyObject *function, PyObject *args) {
} else {
// 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);
// PyThreadState_Clear(new_thread_state);
// PyThreadState_Delete(new_thread_state);

View File

@ -20,7 +20,9 @@
#include "mainThread.h"
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
#endif