Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 385 and fix 393 #395

Merged
merged 13 commits into from
Nov 4, 2022
Merged
Prev Previous commit
Next Next commit
Fix 381 (#382)
* Fix 378.   Refactor condition var signal into common exit path of state SESSION_OPEN_SOCKET_START.

* Fix 381. Incorrect comparison in loop guarding cond_wait from spurious wakeups.
  • Loading branch information
kyle-github authored Sep 24, 2022
commit b7287c2bbfb77ace0040aa274120b64cf37638c9
4 changes: 2 additions & 2 deletions src/lib/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 1644,7 @@ LIB_EXPORT int plc_tag_read(int32_t id, int timeout)
pdebug(DEBUG_WARN, "Error %s while trying to read tag!", plc_tag_decode_error(rc));
plc_tag_abort(id);
}
} while(rc == PLCTAG_STATUS_PENDING && time_ms() > end_time);
} while(rc == PLCTAG_STATUS_PENDING && time_ms() < end_time);

/* the read is not in flight anymore. */
critical_block(tag->api_mutex) {
Expand Down Expand Up @@ -1849,7 1849,7 @@ LIB_EXPORT int plc_tag_write(int32_t id, int timeout)
pdebug(DEBUG_WARN, "Error %s while trying to write tag!", plc_tag_decode_error(rc));
plc_tag_abort(id);
}
} while(rc == PLCTAG_STATUS_PENDING && time_ms() > end_time);
} while(rc == PLCTAG_STATUS_PENDING && time_ms() < end_time);

/* the write is not in flight anymore. */
critical_block(tag->api_mutex) {
Expand Down