mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
some unix changes
This commit is contained in:
parent
5c308a1e08
commit
b02045e7e3
@ -554,9 +554,8 @@ namespace detail
|
||||
|
||||
// TODO Improve the lock here
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
{
|
||||
// Never call callbacks twice!
|
||||
assert(partitions_left);
|
||||
{ // Never call callbacks twice!
|
||||
// assert(partitions_left);
|
||||
|
||||
// If all partitions have completed invoke the final callback.
|
||||
if (--partitions_left == 0)
|
||||
|
||||
6
test.cpp
6
test.cpp
@ -415,13 +415,13 @@ int main(int /*argc*/, char** /*argv*/)
|
||||
[] {
|
||||
return make_continuable([](Callback<bool, bool, double, std::unique_ptr<std::string>>&& callback)
|
||||
{
|
||||
callback(true, false, 0.3f, std::make_unique<std::string>("oh, all work is done!"));
|
||||
callback(true, false, 0.3f/*, std::unique_ptr<std::string>(new std::string("oh, all work is done!"))*/);
|
||||
});
|
||||
},
|
||||
TrivialPromise())
|
||||
.then([](SpellCastResult r0, SpellCastResult r1, bool r2, bool r3, double r4, std::unique_ptr<std::string> message)
|
||||
.then([](SpellCastResult r0, SpellCastResult r1, bool r2, bool r3, double r4/*, std::unique_ptr<std::string> message*/)
|
||||
{
|
||||
return TrivialPromise("Lets see... ").then(Log(*message));
|
||||
return TrivialPromise("Lets see... ")/*.then(Log(*message))*/;
|
||||
})
|
||||
.then([]
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user