Audacity  3.0.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ODTaskThread Class Referencefinal

A thread that executes a part of the task specified by an ODTask. More...

#include <ODTaskThread.h>

Inheritance diagram for ODTaskThread:
[legend]
Collaboration diagram for ODTaskThread:
[legend]

Public Member Functions

 ODTaskThread (ODTask *task)
 

Protected Member Functions

void * Entry () override
 Executes a part of the task. More...
 

Protected Attributes

ODTaskmTask
 

Detailed Description

A thread that executes a part of the task specified by an ODTask.

Definition at line 80 of file ODManager.cpp.

Constructor & Destructor Documentation

◆ ODTaskThread()

ODTaskThread::ODTaskThread ( ODTask task)

Constructs a ODTaskThread

Parameters
taskthe task to be launched as an

Definition at line 97 of file ODManager.cpp.

99 : wxThread()
100 #endif
101 {
102  mTask=task;
103 #ifdef __WXMAC__
104  mDestroy = false;
105  mThread = NULL;
106 #endif
107 
108 }

Member Function Documentation

◆ Entry()

void * ODTaskThread::Entry ( )
overrideprotected

Executes a part of the task.

Definition at line 114 of file ODManager.cpp.

117 {
118  //TODO: Figure out why this has no effect at all.
119  //wxThread::This()->SetPriority( 40);
120  //Do at least 5 percent of the task
121  mTask->DoSome(0.05f);
122 
123  //release the thread count so that the ODManager knows how many active threads are alive.
125 
126 
127 #ifndef __WXMAC__
128  return NULL;
129 #endif
130 }

References ODManager::DecrementCurrentThreads(), and ODManager::Instance.

Here is the call graph for this function:

Member Data Documentation

◆ mTask

ODTask* ODTaskThread::mTask
protected

Definition at line 91 of file ODManager.cpp.


The documentation for this class was generated from the following file:
ODTaskThread::mTask
ODTask * mTask
Definition: ODManager.cpp:91
ODManager::DecrementCurrentThreads
void DecrementCurrentThreads()
Reduces the count of current threads running. Meant to be called when ODTaskThreads end in their own ...
Definition: ODManager.cpp:334
ODManager::Instance
static ODManager *(* Instance)()
Definition: ODManager.h:51
ODTask::DoSome
void DoSome(float amountWork=0.0)
Definition: ODTask.cpp:71