feat add futures
This commit is contained in:
10
src/futures/future_test.cc
Normal file
10
src/futures/future_test.cc
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <sled/futures/future.h>
|
||||
#include <sled/futures/promise.h>
|
||||
|
||||
TEST(Future, Test1)
|
||||
{
|
||||
sled::Promise<int> promise;
|
||||
sled::Future<int> future = promise.GetFuture();
|
||||
promise.SetValue(42);
|
||||
}
|
||||
10
src/system/pid.cc
Normal file
10
src/system/pid.cc
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "sled/system/pid.h"
|
||||
|
||||
namespace sled {
|
||||
pid_t
|
||||
GetCachedPID()
|
||||
{
|
||||
static pid_t cached_pid = getpid();
|
||||
return cached_pid;
|
||||
}
|
||||
}// namespace sled
|
||||
Reference in New Issue
Block a user