diff options
Diffstat (limited to 'src/linda.cpp')
-rw-r--r-- | src/linda.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/linda.cpp b/src/linda.cpp index ea1410e..fb74abe 100644 --- a/src/linda.cpp +++ b/src/linda.cpp | |||
@@ -306,13 +306,13 @@ LUAG_FUNC(linda_send) | |||
306 | 306 | ||
307 | // storage limit hit, wait until timeout or signalled that we should try again | 307 | // storage limit hit, wait until timeout or signalled that we should try again |
308 | { | 308 | { |
309 | enum e_status prev_status = ERROR_ST; // prevent 'might be used uninitialized' warnings | 309 | Lane::Status prev_status{ Lane::Error }; // prevent 'might be used uninitialized' warnings |
310 | if (lane != nullptr) | 310 | if (lane != nullptr) |
311 | { | 311 | { |
312 | // change status of lane to "waiting" | 312 | // change status of lane to "waiting" |
313 | prev_status = lane->status; // RUNNING, most likely | 313 | prev_status = lane->m_status; // Running, most likely |
314 | ASSERT_L(prev_status == RUNNING); // but check, just in case | 314 | ASSERT_L(prev_status == Lane::Running); // but check, just in case |
315 | lane->status = WAITING; | 315 | lane->m_status = Lane::Waiting; |
316 | ASSERT_L(lane->m_waiting_on == nullptr); | 316 | ASSERT_L(lane->m_waiting_on == nullptr); |
317 | lane->m_waiting_on = &linda->m_read_happened; | 317 | lane->m_waiting_on = &linda->m_read_happened; |
318 | } | 318 | } |
@@ -324,7 +324,7 @@ LUAG_FUNC(linda_send) | |||
324 | if (lane != nullptr) | 324 | if (lane != nullptr) |
325 | { | 325 | { |
326 | lane->m_waiting_on = nullptr; | 326 | lane->m_waiting_on = nullptr; |
327 | lane->status = prev_status; | 327 | lane->m_status = prev_status; |
328 | } | 328 | } |
329 | } | 329 | } |
330 | } | 330 | } |
@@ -470,13 +470,13 @@ LUAG_FUNC(linda_receive) | |||
470 | 470 | ||
471 | // nothing received, wait until timeout or signalled that we should try again | 471 | // nothing received, wait until timeout or signalled that we should try again |
472 | { | 472 | { |
473 | enum e_status prev_status = ERROR_ST; // prevent 'might be used uninitialized' warnings | 473 | Lane::Status prev_status{ Lane::Error }; // prevent 'might be used uninitialized' warnings |
474 | if (lane != nullptr) | 474 | if (lane != nullptr) |
475 | { | 475 | { |
476 | // change status of lane to "waiting" | 476 | // change status of lane to "waiting" |
477 | prev_status = lane->status; // RUNNING, most likely | 477 | prev_status = lane->m_status; // Running, most likely |
478 | ASSERT_L(prev_status == RUNNING); // but check, just in case | 478 | ASSERT_L(prev_status == Lane::Running); // but check, just in case |
479 | lane->status = WAITING; | 479 | lane->m_status = Lane::Waiting; |
480 | ASSERT_L(lane->m_waiting_on == nullptr); | 480 | ASSERT_L(lane->m_waiting_on == nullptr); |
481 | lane->m_waiting_on = &linda->m_write_happened; | 481 | lane->m_waiting_on = &linda->m_write_happened; |
482 | } | 482 | } |
@@ -488,7 +488,7 @@ LUAG_FUNC(linda_receive) | |||
488 | if (lane != nullptr) | 488 | if (lane != nullptr) |
489 | { | 489 | { |
490 | lane->m_waiting_on = nullptr; | 490 | lane->m_waiting_on = nullptr; |
491 | lane->status = prev_status; | 491 | lane->m_status = prev_status; |
492 | } | 492 | } |
493 | } | 493 | } |
494 | } | 494 | } |