Skip to content

Commit d63c66a

Browse files
committed
enable_input_merging -> allow_merging
1 parent 8045263 commit d63c66a

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

include/react/Domain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SignalPack;
6565
using REACT_IMPL::TurnFlagsT;
6666

6767
//ETurnFlags
68-
using REACT_IMPL::enable_input_merging;
68+
using REACT_IMPL::allow_merging;
6969

7070
#ifdef REACT_ENABLE_LOGGING
7171
using REACT_IMPL::EventLog;

include/react/detail/ReactiveInput.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ using TransactionFuncT = std::function<void()>;
4444

4545
enum
4646
{
47-
enable_input_merging = 1 << 0
47+
allow_merging = 1 << 0
4848
};
4949

5050
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -278,7 +278,7 @@ class InputManager :
278278
{
279279
// Attempt to add input to another turn.
280280
// If successful, blocks until other turn is done and returns.
281-
bool canMerge = (flags & enable_input_merging) != 0;
281+
bool canMerge = (flags & allow_merging) != 0;
282282
if (canMerge && Engine::TryMergeSync(std::forward<F>(func)))
283283
return;
284284

@@ -454,7 +454,7 @@ class InputManager :
454454
skipPop = false;
455455

456456
// First try to merge to an existing synchronous item in the queue
457-
bool canMerge = (item.Flags & enable_input_merging) != 0;
457+
bool canMerge = (item.Flags & allow_merging) != 0;
458458
if (canMerge && Engine::TryMergeAsync(std::move(item.Func), std::move(item.StatusPtr)))
459459
continue;
460460

@@ -487,7 +487,7 @@ class InputManager :
487487
uint extraCount = 0;
488488
while (extraCount < 100 && asyncQueue_.try_pop(item))
489489
{
490-
bool canMergeNext = (item.Flags & enable_input_merging) != 0;
490+
bool canMergeNext = (item.Flags & allow_merging) != 0;
491491
if (canMergeNext)
492492
{
493493
item.Func();
@@ -540,7 +540,7 @@ class InputManager :
540540
void processContinuationData(TurnFlagsT flags)
541541
{
542542
// No merging for continuations
543-
flags &= ~enable_input_merging;
543+
flags &= ~allow_merging;
544544

545545
continuation_.template DetachQueuedObservers<D>();
546546

tests/src/TransactionTest.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,25 +268,25 @@ TYPED_TEST_P(TransactionTest, Merging1)
268268
// Todo: improve this as it'll fail occasionally
269269
shouldSpin = true;
270270
std::thread t1([&] {
271-
D::DoTransaction(enable_input_merging, [&] {
271+
D::DoTransaction(allow_merging, [&] {
272272
n1 <<= 2;
273273
});
274274
});
275275
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
276276
std::thread t2([&] {
277-
D::DoTransaction(enable_input_merging, [&] {
277+
D::DoTransaction(allow_merging, [&] {
278278
n1 <<= 3;
279279
});
280280
});
281281
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
282282
std::thread t3([&] {
283-
D::DoTransaction(enable_input_merging, [&] {
283+
D::DoTransaction(allow_merging, [&] {
284284
n1 <<= 4;
285285
});
286286
});
287287
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
288288
std::thread t4([&] {
289-
D::DoTransaction(enable_input_merging, [&] {
289+
D::DoTransaction(allow_merging, [&] {
290290
n1 <<= 5;
291291
});
292292

@@ -360,7 +360,7 @@ TYPED_TEST_P(TransactionTest, AsyncMerging1)
360360

361361
TransactionStatus st;
362362

363-
D::AsyncTransaction(enable_input_merging, st, [&] {
363+
D::AsyncTransaction(allow_merging, st, [&] {
364364
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
365365
in <<= 10;
366366
});
@@ -369,11 +369,11 @@ TYPED_TEST_P(TransactionTest, AsyncMerging1)
369369
std::this_thread::sleep_for(std::chrono::milliseconds(10));
370370

371371
// These two can still be pulled in after the first input function is done
372-
D::AsyncTransaction(enable_input_merging, st, [&] {
372+
D::AsyncTransaction(allow_merging, st, [&] {
373373
in <<= 20;
374374
});
375375

376-
D::AsyncTransaction(enable_input_merging, st, [&] {
376+
D::AsyncTransaction(allow_merging, st, [&] {
377377
in <<= 30;
378378
});
379379

@@ -383,11 +383,11 @@ TYPED_TEST_P(TransactionTest, AsyncMerging1)
383383
});
384384

385385
// These two should be merged again
386-
D::AsyncTransaction(enable_input_merging, st, [&] {
386+
D::AsyncTransaction(allow_merging, st, [&] {
387387
in <<= 50;
388388
});
389389

390-
D::AsyncTransaction(enable_input_merging, st, [&] {
390+
D::AsyncTransaction(allow_merging, st, [&] {
391391
in <<= 60;
392392
});
393393

0 commit comments

Comments
 (0)