summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/Promise.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2014-01-02 13:32:55 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2014-01-02 13:32:55 +0100
commit042b72bc172e7eb4e9ef7668ae28be6e7a3b4036 (patch)
tree7e3d265d3d1fde9f80f3f4623c2f59a5b0521b65 /src/OSSupport/Promise.cpp
parentMerge branch 'master' into threadsafequeue (diff)
downloadcuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.gz
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.bz2
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.lz
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.xz
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.tar.zst
cuberite-042b72bc172e7eb4e9ef7668ae28be6e7a3b4036.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/Promise.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/OSSupport/Promise.cpp b/src/OSSupport/Promise.cpp
deleted file mode 100644
index b31869334..000000000
--- a/src/OSSupport/Promise.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-
-#include "Globals.h"
-
-#include "Promise.h"
-
-cPromise * cPromise::WaitFor(cPromise * a_Promise)
-{
- return new cCombinedPromise(this, a_Promise);
-}
-
-cPromise * cPromise::CancelOn(volatile bool& cancelation)
-{
- return new cCancelablePromise(this, cancelation);
-}
-
-void cPromise::Wait()
-{
- while(!IsCompleted()){}; //busywait best we can do until waitany
-}
-
-
-cCombinedPromise::cCombinedPromise(cPromise* a_left, cPromise* a_right) :
- cPromise(),
- m_left(a_left),
- m_right(a_right)
-{
-}
-
-cCombinedPromise::~cCombinedPromise()
-{
-}
-
-bool cCombinedPromise::IsCompleted()
-{
- return m_left->IsCompleted() || m_right->IsCompleted();
-}
-
-cCancelablePromise::cCancelablePromise(cPromise* a_wrapped, volatile bool& a_cancel) :
- cPromise(),
- m_cancel(a_cancel),
- m_wrapped(a_wrapped)
-{
-}
-
-cCancelablePromise::~cCancelablePromise ()
-{
-}
-
-bool cCancelablePromise::IsCompleted()
-{
- return m_cancel || m_wrapped->IsCompleted();
-}
-
-