From eb150a51cd1e439fd719fe3cd3f30c53f9a1348a Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 5 Mar 2012 22:11:05 +0100 Subject: Remove unused QThreadPoolPrivate::startFrontRunnable(). Change-Id: Ie079aea3412a53cf9dccaa770fa64ff5b6b7b3b1 Reviewed-by: Stephen Kelly --- src/corelib/thread/qthreadpool.cpp | 25 ------------------------- src/corelib/thread/qthreadpool_p.h | 1 - 2 files changed, 26 deletions(-) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index af8c99197e..b7021817c5 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -307,31 +307,6 @@ bool QThreadPoolPrivate::waitForDone(int msecs) return queue.isEmpty() && activeThreads == 0; } -/*! \internal - Pulls a runnable from the front queue and runs it in the current thread. Blocks - until the runnable has completed. Returns true if a runnable was found. -*/ -bool QThreadPoolPrivate::startFrontRunnable() -{ - QMutexLocker locker(&mutex); - if (queue.isEmpty()) - return false; - - QRunnable *runnable = queue.takeFirst().first; - const bool autoDelete = runnable->autoDelete(); - bool del = autoDelete && !--runnable->ref; - - locker.unlock(); - runnable->run(); - locker.relock(); - - if (del) { - delete runnable; - } - - return true; -} - /*! \internal Seaches for \a runnable in the queue, removes it from the queue and runs it if found. This functon does not return until the runnable diff --git a/src/corelib/thread/qthreadpool_p.h b/src/corelib/thread/qthreadpool_p.h index 9a7c09695f..910e0b0714 100644 --- a/src/corelib/thread/qthreadpool_p.h +++ b/src/corelib/thread/qthreadpool_p.h @@ -83,7 +83,6 @@ public: void startThread(QRunnable *runnable = 0); void reset(); bool waitForDone(int msecs = -1); - bool startFrontRunnable(); void stealRunnable(QRunnable *); mutable QMutex mutex; -- cgit v1.2.3