Project restructuring (fixes macOS builds) (#198)
- Create `Include/` folder for all main projects - Fix some issues here and there (found while moving things) - All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
This commit is contained in:
committed by
GitHub
parent
7856827ecf
commit
c87200a80d
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "Dispatcher.h"
|
||||
|
||||
namespace tt {
|
||||
|
||||
/** Starts a Thread to process dispatched messages */
|
||||
class DispatcherThread {
|
||||
|
||||
Dispatcher dispatcher;
|
||||
std::unique_ptr<Thread> thread;
|
||||
bool interruptThread = false;
|
||||
|
||||
public:
|
||||
|
||||
explicit DispatcherThread(const std::string& threadName, size_t threadStackSize = 4096);
|
||||
~DispatcherThread();
|
||||
|
||||
/**
|
||||
* Dispatch a message.
|
||||
*/
|
||||
void dispatch(Dispatcher::Function function, std::shared_ptr<void> context);
|
||||
|
||||
/** Start the thread (blocking). */
|
||||
void start();
|
||||
|
||||
/** Stop the thread (blocking). */
|
||||
void stop();
|
||||
|
||||
/** Internal method */
|
||||
void _threadMain();
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user