split project with app & doric module
This commit is contained in:
17
doric-Qt/example/doric/async/DoricSettableFuture.cpp
Normal file
17
doric-Qt/example/doric/async/DoricSettableFuture.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "DoricSettableFuture.h"
|
||||
|
||||
void DoricSettableFuture::set(QJSValue result) {
|
||||
if (mReadyLatch == NULL) {
|
||||
qDebug() << "Result has already been set!";
|
||||
return;
|
||||
}
|
||||
mResult = result;
|
||||
delete mReadyLatch;
|
||||
}
|
||||
|
||||
QJSValue DoricSettableFuture::get() {
|
||||
mReadyLatch->lock();
|
||||
return mResult;
|
||||
}
|
||||
Reference in New Issue
Block a user