mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-12 23:26:10 -05:00
68 lines
1.2 KiB
C++
68 lines
1.2 KiB
C++
#include "IOThread.h"
|
|
|
|
IOThread::IOThread() {
|
|
terminated.store(false);
|
|
}
|
|
|
|
IOThread::~IOThread() {
|
|
|
|
}
|
|
|
|
#ifdef __APPLE__
|
|
void *IOThread::threadMain() {
|
|
terminated.store(false);
|
|
run();
|
|
return this;
|
|
};
|
|
|
|
void *IOThread::pthread_helper(void *context) {
|
|
return ((IOThread *) context)->threadMain();
|
|
};
|
|
#else
|
|
void IOThread::threadMain() {
|
|
terminated.store(false);
|
|
run();
|
|
};
|
|
#endif
|
|
|
|
void IOThread::setup() {
|
|
|
|
};
|
|
|
|
void IOThread::run() {
|
|
|
|
};
|
|
|
|
void IOThread::terminate() {
|
|
terminated.store(true);
|
|
};
|
|
|
|
void IOThread::onBindOutput(std::string name, ThreadQueueBase* threadQueue) {
|
|
|
|
};
|
|
|
|
void IOThread::onBindInput(std::string name, ThreadQueueBase* threadQueue) {
|
|
|
|
};
|
|
|
|
void IOThread::setInputQueue(std::string qname, ThreadQueueBase *threadQueue) {
|
|
input_queues[qname] = threadQueue;
|
|
this->onBindInput(qname, threadQueue);
|
|
};
|
|
|
|
void *IOThread::getInputQueue(std::string qname) {
|
|
return input_queues[qname];
|
|
};
|
|
|
|
void IOThread::setOutputQueue(std::string qname, ThreadQueueBase *threadQueue) {
|
|
output_queues[qname] = threadQueue;
|
|
this->onBindOutput(qname, threadQueue);
|
|
};
|
|
|
|
void *IOThread::getOutputQueue(std::string qname) {
|
|
return output_queues[qname];
|
|
};
|
|
|
|
bool IOThread::isTerminated() {
|
|
return terminated.load();
|
|
} |