aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/executor.cc4
-rw-r--r--lib/executor.h4
-rw-r--r--lib/thread.cc16
-rw-r--r--lib/thread.h4
4 files changed, 21 insertions, 7 deletions
diff --git a/lib/executor.cc b/lib/executor.cc
index bd068c6..3d3c044 100644
--- a/lib/executor.cc
+++ b/lib/executor.cc
@@ -22,5 +22,7 @@ namespace nMatcha {
}
}
- void Executor::yield_to(const Thread* t) const { ::yield(t->mStackPtr, &mStackPtr); }
+ void Executor::yield_to(const Thread* t) const {
+ ::yield(t->mStackPtr, &mStackPtr);
+ }
} // namespace nMatcha
diff --git a/lib/executor.h b/lib/executor.h
index 67493d4..f04f3f1 100644
--- a/lib/executor.h
+++ b/lib/executor.h
@@ -13,7 +13,9 @@ namespace nMatcha {
Executor& operator=(const Executor&) = delete;
Executor() = default;
- const void* getStackPtr() const { return mStackPtr; }
+ const void* getStackPtr() const {
+ return mStackPtr;
+ }
void spawn(std::unique_ptr<Thread> t);
void run();
diff --git a/lib/thread.cc b/lib/thread.cc
index e6777c0..ed2dee3 100644
--- a/lib/thread.cc
+++ b/lib/thread.cc
@@ -12,7 +12,9 @@
#include <unistd.h> // sysconf
namespace {
- static long get_pagesize() { return ::sysconf(_SC_PAGESIZE); }
+ static long get_pagesize() {
+ return ::sysconf(_SC_PAGESIZE);
+ }
} // namespace
namespace nMatcha {
@@ -57,9 +59,15 @@ namespace nMatcha {
::yield(mExecutor->getStackPtr(), &mStackPtr);
}
- std::unique_ptr<Thread> FnThread::make(UserFn f) { return std::make_unique<FnThread>(CreatorToken{}, f); }
+ std::unique_ptr<Thread> FnThread::make(UserFn f) {
+ return std::make_unique<FnThread>(CreatorToken{}, f);
+ }
- void FnThread::threadFn() { mUserFn(*this); }
+ void FnThread::threadFn() {
+ mUserFn(*this);
+ }
- void FnThread::yield() { Thread::yield(); }
+ void FnThread::yield() {
+ Thread::yield();
+ }
} // namespace nMatcha
diff --git a/lib/thread.h b/lib/thread.h
index 3304892..c181425 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -16,7 +16,9 @@ namespace nMatcha {
virtual void threadFn() = 0;
- bool isFinished() const { return mFinished; }
+ bool isFinished() const {
+ return mFinished;
+ }
protected:
void yield();