Skip to content
Snippets Groups Projects

Move all definitions from emper.hpp in compilation unit

2 files
+ 41
25
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 6
25
@@ -11,31 +11,15 @@
@@ -11,31 +11,15 @@
#include "Runtime.hpp"
#include "Runtime.hpp"
#include "SynchronizedFiber.hpp"
#include "SynchronizedFiber.hpp"
void async(Fiber* fiber) {
void async(Fiber* fiber);
assert(fiber != nullptr);
Runtime* runtime = Runtime::getRuntime();
runtime->schedule(*fiber);
}
void async(Fiber::fiber_fun_t function, void* arg) {
void async(Fiber::fiber_fun_t function, void* arg);
Fiber* fiber = Fiber::from(std::move(function), arg);
async(fiber);
}
void async(const Fiber::fiber_fun0_t& function) {
void async(const Fiber::fiber_fun0_t& function);
Fiber* fiber = Fiber::from(function);
async(fiber);
}
void async(Fiber::fiber_fun_t function, void* arg, workeraffinity_t* affinity) {
void async(Fiber::fiber_fun_t function, void* arg, workeraffinity_t* affinity);
Fiber* fiber = Fiber::from(std::move(function), arg, affinity);
async(fiber);
}
void async(const Fiber::fiber_fun0_t& function, workeraffinity_t* affinity) {
void async(const Fiber::fiber_fun0_t& function, workeraffinity_t* affinity);
Fiber* fiber = Fiber::from(function, affinity);
async(fiber);
}
template <typename S>
template <typename S>
void spawn(Fiber::fiber_fun_t function, void* arg, S& semaphore) {
void spawn(Fiber::fiber_fun_t function, void* arg, S& semaphore) {
@@ -69,10 +53,7 @@ void init_runtime(workerid_t worker_count);
@@ -69,10 +53,7 @@ void init_runtime(workerid_t worker_count);
void destroy_runtime();
void destroy_runtime();
void yield() {
void yield();
Runtime* runtime = Runtime::getRuntime();
runtime->yield();
}
auto sleep(unsigned int seconds) -> bool;
auto sleep(unsigned int seconds) -> bool;
Loading