diff --git a/panda/src/pipeline/conditionVarDebug.cxx b/panda/src/pipeline/conditionVarDebug.cxx index 423d4cd757..d8a482b52f 100755 --- a/panda/src/pipeline/conditionVarDebug.cxx +++ b/panda/src/pipeline/conditionVarDebug.cxx @@ -83,7 +83,7 @@ wait() { return; } - if (thread_cat.is_spam()) { + if (thread_cat->is_spam()) { thread_cat.spam() << *Thread::get_current_thread() << " waiting on " << *this << "\n"; } @@ -129,7 +129,7 @@ signal() { return; } - if (thread_cat.is_spam()) { + if (thread_cat->is_spam()) { thread_cat.spam() << *Thread::get_current_thread() << " signalling " << *this << "\n"; } diff --git a/panda/src/pipeline/conditionVarFullDebug.cxx b/panda/src/pipeline/conditionVarFullDebug.cxx index 273a76a72d..4997bf21e6 100644 --- a/panda/src/pipeline/conditionVarFullDebug.cxx +++ b/panda/src/pipeline/conditionVarFullDebug.cxx @@ -83,7 +83,7 @@ wait() { return; } - if (thread_cat.is_spam()) { + if (thread_cat->is_spam()) { thread_cat.spam() << *Thread::get_current_thread() << " waiting on " << *this << "\n"; } @@ -129,7 +129,7 @@ signal() { return; } - if (thread_cat.is_spam()) { + if (thread_cat->is_spam()) { thread_cat.spam() << *Thread::get_current_thread() << " signalling " << *this << "\n"; } @@ -164,7 +164,7 @@ signal_all() { return; } - if (thread_cat.is_spam()) { + if (thread_cat->is_spam()) { thread_cat.spam() << *Thread::get_current_thread() << " signalling all " << *this << "\n"; } diff --git a/panda/src/pipeline/mutexDebug.cxx b/panda/src/pipeline/mutexDebug.cxx index 9386c9e4f4..dd77309e3d 100755 --- a/panda/src/pipeline/mutexDebug.cxx +++ b/panda/src/pipeline/mutexDebug.cxx @@ -128,7 +128,7 @@ do_lock() { // Go to sleep on the condition variable until it's unlocked. - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << *this_thread << " blocking on " << *this << " (held by " << *_locking_thread << ")\n"; @@ -202,7 +202,7 @@ do_debug_is_locked() const { //////////////////////////////////////////////////////////////////// void MutexDebug:: report_deadlock(Thread *this_thread) { - thread_cat.error() + thread_cat->error() << "\n\n" << "****************************************************************\n" << "***** Deadlock detected! *****\n" diff --git a/panda/src/pipeline/thread.cxx b/panda/src/pipeline/thread.cxx index ca83005710..33a567e83b 100644 --- a/panda/src/pipeline/thread.cxx +++ b/panda/src/pipeline/thread.cxx @@ -151,7 +151,7 @@ start(ThreadPriority priority, bool joinable) { nassertr(!_started, false); if (!support_threads) { - thread_cat.warning() + thread_cat->warning() << *this << " could not be started: support-threads is false.\n"; return false; } @@ -159,7 +159,7 @@ start(ThreadPriority priority, bool joinable) { _started = _impl.start(priority, joinable); if (!_started) { - thread_cat.warning() + thread_cat->warning() << *this << " could not be started!\n"; } diff --git a/panda/src/pipeline/threadPosixImpl.cxx b/panda/src/pipeline/threadPosixImpl.cxx index 1d199ca956..68fe2a5bca 100644 --- a/panda/src/pipeline/threadPosixImpl.cxx +++ b/panda/src/pipeline/threadPosixImpl.cxx @@ -32,7 +32,7 @@ bool ThreadPosixImpl::_got_pt_ptr_index = false; //////////////////////////////////////////////////////////////////// ThreadPosixImpl:: ~ThreadPosixImpl() { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Deleting thread " << _parent_obj->get_name() << "\n"; } @@ -67,7 +67,7 @@ setup_main_thread() { bool ThreadPosixImpl:: start(ThreadPriority priority, bool joinable) { _mutex.lock(); - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Starting " << *_parent_obj << "\n"; } @@ -94,7 +94,7 @@ start(ThreadPriority priority, bool joinable) { int result = pthread_attr_setstacksize(&attr, thread_stack_size); if (result != 0) { - thread_cat.warning() + thread_cat->warning() << "Unable to set stack size.\n"; } @@ -102,7 +102,7 @@ start(ThreadPriority priority, bool joinable) { // run in parallel with other threads. result = pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); if (result != 0) { - thread_cat.warning() + thread_cat->warning() << "Unable to set system scope.\n"; } @@ -110,7 +110,7 @@ start(ThreadPriority priority, bool joinable) { int current_policy = SCHED_OTHER; result = pthread_attr_setschedpolicy(&attr, current_policy); if (result != 0) { - thread_cat.warning() + thread_cat->warning() << "Unable to set scheduling policy.\n"; } @@ -134,7 +134,7 @@ start(ThreadPriority priority, bool joinable) { } if (result != 0) { - thread_cat.warning() + thread_cat->warning() << "Unable to specify thread priority.\n"; } @@ -220,7 +220,7 @@ root_func(void *data) { self->_parent_obj->thread_main(); - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Terminating thread " << self->_parent_obj->get_name() << ", count = " << self->_parent_obj->get_ref_count() << "\n"; @@ -257,7 +257,7 @@ init_pt_ptr_index() { int result = pthread_key_create(&_pt_ptr_index, NULL); if (result != 0) { - thread_cat.error() + thread_cat->error() << "Unable to associate Thread pointers with threads.\n"; return; } diff --git a/panda/src/pipeline/threadSimpleImpl.cxx b/panda/src/pipeline/threadSimpleImpl.cxx index ff651a5019..56a0066135 100644 --- a/panda/src/pipeline/threadSimpleImpl.cxx +++ b/panda/src/pipeline/threadSimpleImpl.cxx @@ -55,7 +55,7 @@ ThreadSimpleImpl(Thread *parent_obj) : //////////////////////////////////////////////////////////////////// ThreadSimpleImpl:: ~ThreadSimpleImpl() { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Deleting thread " << _parent_obj->get_name() << "\n"; } @@ -88,7 +88,7 @@ setup_main_thread() { //////////////////////////////////////////////////////////////////// bool ThreadSimpleImpl:: start(ThreadPriority priority, bool joinable) { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Starting " << *_parent_obj << "\n"; } diff --git a/panda/src/pipeline/threadSimpleManager.cxx b/panda/src/pipeline/threadSimpleManager.cxx index cc150b6147..73a8c6e63f 100644 --- a/panda/src/pipeline/threadSimpleManager.cxx +++ b/panda/src/pipeline/threadSimpleManager.cxx @@ -77,7 +77,7 @@ enqueue_ready(ThreadSimpleImpl *thread) { //////////////////////////////////////////////////////////////////// void ThreadSimpleManager:: enqueue_sleep(ThreadSimpleImpl *thread, double seconds) { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << *_current_thread->_parent_obj << " sleeping for " << seconds << " seconds\n"; @@ -434,7 +434,7 @@ choose_next_context() { // All threads are sleeping. double wait = _sleeping.front()->_start_time - now; if (wait > 0.0) { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Sleeping all threads " << wait << " seconds\n"; } @@ -446,7 +446,7 @@ choose_next_context() { } else { // No threads are ready! if (!_blocked.empty()) { - thread_cat.error() + thread_cat->error() << "Deadlock! All threads blocked.\n"; report_deadlock(); abort(); @@ -464,7 +464,7 @@ choose_next_context() { // No threads are queued anywhere. This is some kind of // internal error, since normally the main thread, at least, // should be queued somewhere. - thread_cat.error() + thread_cat->error() << "All threads disappeared!\n"; exit(0); } @@ -475,7 +475,7 @@ choose_next_context() { _current_thread->_start_time = now; // All right, the thread is ready to roll. Begin. - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { size_t blocked_count = 0; Blocked::const_iterator bi; for (bi = _blocked.begin(); bi != _blocked.end(); ++bi) { @@ -550,7 +550,7 @@ kill_non_joinable(ThreadSimpleManager::FifoThreads &threads) { if (thread->_joinable) { new_threads.push_back(thread); } else { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Killing " << *thread->_parent_obj << "\n"; } @@ -577,7 +577,7 @@ kill_non_joinable(ThreadSimpleManager::Sleeping &threads) { if (thread->_joinable) { new_threads.push_back(thread); } else { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Killing " << *thread->_parent_obj << "\n"; } diff --git a/panda/src/pipeline/threadWin32Impl.cxx b/panda/src/pipeline/threadWin32Impl.cxx index 6716c9080f..156418ec5f 100644 --- a/panda/src/pipeline/threadWin32Impl.cxx +++ b/panda/src/pipeline/threadWin32Impl.cxx @@ -31,7 +31,7 @@ bool ThreadWin32Impl::_got_pt_ptr_index = false; //////////////////////////////////////////////////////////////////// ThreadWin32Impl:: ~ThreadWin32Impl() { - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Deleting thread " << _parent_obj->get_name() << "\n"; } @@ -58,7 +58,7 @@ setup_main_thread() { bool ThreadWin32Impl:: start(ThreadPriority priority, bool joinable) { _mutex.lock(); - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Starting " << *_parent_obj << "\n"; } @@ -175,7 +175,7 @@ root_func(LPVOID data) { self->_parent_obj->thread_main(); - if (thread_cat.is_debug()) { + if (thread_cat->is_debug()) { thread_cat.debug() << "Terminating thread " << self->_parent_obj->get_name() << ", count = " << self->_parent_obj->get_ref_count() << "\n"; @@ -213,7 +213,7 @@ init_pt_ptr_index() { _pt_ptr_index = TlsAlloc(); if (_pt_ptr_index == TLS_OUT_OF_INDEXES) { - thread_cat.error() + thread_cat->error() << "Unable to associate Thread pointers with threads.\n"; return; }