History

First pass at threaded texture transfers

Brad Davis committed 10 years ago

Commit d98abbc1 parent 2dd1b1418 files · +528 −222Browse files

Showing the changes to libraries/shared/src/GenericThread.cpp (1 of 18 files). Show all

Unified · Split

libraries/shared/src/GenericThread.cpp+16−3
@@ -46,6 +46,8 @@ void GenericThread::initialize(bool isThreaded, QThread::Priority priority) { · 45 unmodified lines
4646 _thread->start();
4747
4848 _thread->setPriority(priority);
49+ } else {
50+ setup();
4951 }
5052 }
5153
@@ -60,10 +62,16 @@ void GenericThread::terminate() { · 8 unmodified lines
6062 _thread->deleteLater();
6163 _thread = NULL;
6264 }
65+ } else {
66+ shutdown();
6367 }
6468 }
6569
6670 void GenericThread::threadRoutine() {
71+ if (_isThreaded) {
72+ setup();
73+ }
74+
6775 while (!_stopThread) {
6876
6977 // override this function to do whatever your class actually does, return false to exit thread early
@@ -78,8 +86,13 @@ void GenericThread::threadRoutine() { · 8 unmodified lines
7886 }
7987 }
8088
81− // If we were on a thread, then quit our thread
82− if (_isThreaded && _thread) {
83− _thread->quit();
89+ if (_isThreaded) {
90+ shutdown();
91+
92+ // If we were on a thread, then quit our thread
93+ if (_thread) {
94+ _thread->quit();
95+ }
8496 }
97+
8598 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t