Skip to content

Commit 1782c19

Browse files
committed
#7 - Added freeOnTerminate to Thread's Constructor
1 parent 43309d8 commit 1782c19

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/ESPressio_Thread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace ESPressio {
88
namespace Threads {
99

1010
// Define the Constructor and Destructor of `Thread` here
11-
Thread::Thread(bool freeOnTerminate = false) : _threadID(0) {
11+
Thread::Thread() : _threadID(0) {
1212
SetFreeOnTerminate(freeOnTerminate);
1313
_threadID = ThreadManager::GetInstance()->GetThreadCount();
1414
SetCoreID(ThreadManager::GetInstance()->AddThread(this));

src/ESPressio_Thread.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ namespace ESPressio {
7070
}
7171
public:
7272
// Constructor/Destructor
73-
Thread(bool freeOnTerminate = false);
73+
Thread();
74+
75+
Thread(bool freeOnTerminate) : Thread() {
76+
SetFreeOnTerminate(freeOnTerminate);
77+
}
7478

7579
~Thread();
7680

0 commit comments

Comments
 (0)