Finale PDK Framework  0.54
ff_threads.h
1 /*
2  * File: ff_threads.h
3  * Author: Jari Williamsson
4  *
5  * Created on den 16 oktober 2014, 15:05
6  */
7 
8 #ifndef FF_THREADS_H
9 #define FF_THREADS_H
10 
11 #if OPERATING_SYSTEM == MAC_OS
12 #include <pthread.h>
13 #endif
14 
15 
18 class FCThread : public __FCBase
19 {
20  bool _executing;
21 
22 #if OPERATING_SYSTEM == WINDOWS
23  DWORD _returnvalue;
24  HANDLE _threadhandle;
25 #else
26  /* Mac - Cocoa */
27  pthread_attr_t _attr;
28  pthread_t _posixThreadID;
29 #endif
30 
31  public:
34  {
35  _executing = false;
36  }
37 
39  bool Start();
40 
42  virtual void Execute() {}
43 
45  void _Executor();
46 
48  bool IsExecuting() { return _executing; }
49 
51  void WaitUntilEnd();
52 };
53 
54 
55 #endif /* FF_THREADS_H */
56 
virtual void Execute()
The running code for the thread. Override in child classes.
Definition: ff_threads.h:42
void _Executor()
For internal use only!
Definition: finaleframework.cpp:32631
Base class for the Finale Framework classes.
Definition: ff_base.h:47
Class for multithreading.
Definition: ff_threads.h:18
bool Start()
Starts the execution of a thread.
Definition: finaleframework.cpp:32603
FCThread()
The constructor.
Definition: ff_threads.h:33
bool IsExecuting()
Returns true if a thread is executing.
Definition: ff_threads.h:48
void WaitUntilEnd()
Waits until the thread ends. This can only be called from the main thread.
Definition: finaleframework.cpp:32638