diff options
Diffstat (limited to 'src/linda.cpp')
-rw-r--r-- | src/linda.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/linda.cpp b/src/linda.cpp index fa27871..4cc356a 100644 --- a/src/linda.cpp +++ b/src/linda.cpp | |||
@@ -137,7 +137,7 @@ LUAG_FUNC( linda_send) | |||
137 | ++ key_i; | 137 | ++ key_i; |
138 | } | 138 | } |
139 | 139 | ||
140 | bool const as_nil_sentinel{ equal_unique_key(L, key_i, NIL_SENTINEL) };// if not nullptr, send() will silently send a single nil if nothing is provided | 140 | bool const as_nil_sentinel{ NIL_SENTINEL.equals(L, key_i) }; // if not nullptr, send() will silently send a single nil if nothing is provided |
141 | if( as_nil_sentinel) | 141 | if( as_nil_sentinel) |
142 | { | 142 | { |
143 | // the real key to send data to is after the NIL_SENTINEL marker | 143 | // the real key to send data to is after the NIL_SENTINEL marker |
@@ -155,7 +155,7 @@ LUAG_FUNC( linda_send) | |||
155 | if( as_nil_sentinel) | 155 | if( as_nil_sentinel) |
156 | { | 156 | { |
157 | // send a single nil if nothing is provided | 157 | // send a single nil if nothing is provided |
158 | push_unique_key( L, NIL_SENTINEL); | 158 | NIL_SENTINEL.push(L); |
159 | } | 159 | } |
160 | else | 160 | else |
161 | { | 161 | { |
@@ -243,7 +243,7 @@ LUAG_FUNC( linda_send) | |||
243 | { | 243 | { |
244 | case CANCEL_SOFT: | 244 | case CANCEL_SOFT: |
245 | // if user wants to soft-cancel, the call returns lanes.cancel_error | 245 | // if user wants to soft-cancel, the call returns lanes.cancel_error |
246 | push_unique_key( L, CANCEL_ERROR); | 246 | CANCEL_ERROR.push(L); |
247 | return 1; | 247 | return 1; |
248 | 248 | ||
249 | case CANCEL_HARD: | 249 | case CANCEL_HARD: |
@@ -397,7 +397,7 @@ LUAG_FUNC( linda_receive) | |||
397 | { | 397 | { |
398 | case CANCEL_SOFT: | 398 | case CANCEL_SOFT: |
399 | // if user wants to soft-cancel, the call returns CANCEL_ERROR | 399 | // if user wants to soft-cancel, the call returns CANCEL_ERROR |
400 | push_unique_key( L, CANCEL_ERROR); | 400 | CANCEL_ERROR.push(L); |
401 | return 1; | 401 | return 1; |
402 | 402 | ||
403 | case CANCEL_HARD: | 403 | case CANCEL_HARD: |
@@ -458,7 +458,7 @@ LUAG_FUNC( linda_set) | |||
458 | else // linda is cancelled | 458 | else // linda is cancelled |
459 | { | 459 | { |
460 | // do nothing and return lanes.cancel_error | 460 | // do nothing and return lanes.cancel_error |
461 | push_unique_key( L, CANCEL_ERROR); | 461 | CANCEL_ERROR.push(L); |
462 | pushed = 1; | 462 | pushed = 1; |
463 | } | 463 | } |
464 | } | 464 | } |
@@ -522,7 +522,7 @@ LUAG_FUNC( linda_get) | |||
522 | else // linda is cancelled | 522 | else // linda is cancelled |
523 | { | 523 | { |
524 | // do nothing and return lanes.cancel_error | 524 | // do nothing and return lanes.cancel_error |
525 | push_unique_key( L, CANCEL_ERROR); | 525 | CANCEL_ERROR.push(L); |
526 | pushed = 1; | 526 | pushed = 1; |
527 | } | 527 | } |
528 | // an error can be raised if we attempt to read an unregistered function | 528 | // an error can be raised if we attempt to read an unregistered function |
@@ -570,7 +570,7 @@ LUAG_FUNC( linda_limit) | |||
570 | else // linda is cancelled | 570 | else // linda is cancelled |
571 | { | 571 | { |
572 | // do nothing and return lanes.cancel_error | 572 | // do nothing and return lanes.cancel_error |
573 | push_unique_key( L, CANCEL_ERROR); | 573 | CANCEL_ERROR.push(L); |
574 | pushed = 1; | 574 | pushed = 1; |
575 | } | 575 | } |
576 | } | 576 | } |
@@ -798,7 +798,7 @@ static void* linda_id( lua_State* L, DeepOp op_) | |||
798 | } | 798 | } |
799 | if( s) | 799 | if( s) |
800 | { | 800 | { |
801 | s->prelude.magic.value = DEEP_VERSION.value; | 801 | s->prelude.DeepPrelude::DeepPrelude(); |
802 | SIGNAL_INIT( &s->read_happened); | 802 | SIGNAL_INIT( &s->read_happened); |
803 | SIGNAL_INIT( &s->write_happened); | 803 | SIGNAL_INIT( &s->write_happened); |
804 | s->U = universe_get( L); | 804 | s->U = universe_get( L); |
@@ -901,7 +901,7 @@ static void* linda_id( lua_State* L, DeepOp op_) | |||
901 | lua_pushliteral( L, BATCH_SENTINEL); | 901 | lua_pushliteral( L, BATCH_SENTINEL); |
902 | lua_setfield( L, -2, "batched"); | 902 | lua_setfield( L, -2, "batched"); |
903 | 903 | ||
904 | push_unique_key( L, NIL_SENTINEL); | 904 | NIL_SENTINEL.push(L); |
905 | lua_setfield( L, -2, "null"); | 905 | lua_setfield( L, -2, "null"); |
906 | 906 | ||
907 | STACK_END( L, 1); | 907 | STACK_END( L, 1); |