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
46 _thread->start();46 _thread->start();
47 47
48 _thread->setPriority(priority);48 _thread->setPriority(priority);
49 } else {
50 setup();
49 }51 }
50}52}
51 53
@@ -60,10 +62,16 @@ void GenericThread::terminate() { · 8 unmodified lines
60 _thread->deleteLater();62 _thread->deleteLater();
61 _thread = NULL;63 _thread = NULL;
62 }64 }
65 } else {
66 shutdown();
63 }67 }
64}68}
65 69
66void GenericThread::threadRoutine() {70void GenericThread::threadRoutine() {
71 if (_isThreaded) {
72 setup();
73 }
74
67 while (!_stopThread) {75 while (!_stopThread) {
68 76
69 // override this function to do whatever your class actually does, return false to exit thread early77 // 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
78 }86 }
79 }87 }
80 88
81 // If we were on a thread, then quit our thread89 if (_isThreaded) {
82 if (_isThreaded && _thread) {90 shutdown();
83 _thread->quit();91
92 // If we were on a thread, then quit our thread
93 if (_thread) {
94 _thread->quit();
95 }
84 }96 }
97
85}98}

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