Conversation
andyhhp
left a comment
There was a problem hiding this comment.
I think you do want to split the mechanical fixes from the logical fixes (esp the lock contention one).
| SM_PHASE p2, | ||
| MTC_BOOLEAN on_heartbeat, | ||
| MTC_BOOLEAN on_statefile) | ||
| { |
There was a problem hiding this comment.
I think you want to de-indent the new rendezvous_wait() too
There was a problem hiding this comment.
I'll add a separate commit that deindents these
| MTC_BOOLEAN writable) | ||
| { | ||
| { | ||
| PCOM_DATA_SF psf; |
There was a problem hiding this comment.
Similarly here, where you've de-indented the braces but not the rest of the function
b96eb51 to
c2098f5
Compare
Reduce the scope of the global com mutex, otherwise every attempt to acquire a reader lock results in contention on this global mutex. Use a per-object-table lock instead. Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Nested functions are a GCC-only extension and are not supported by clang and clangd at all. Signed-off-by: Edwin Török <edwin.torok@cloud.com>
TODO: use pthread_condattr_setclock and switch to a monotonic clock instead Signed-off-by: Edwin Török <edwin.torok@cloud.com>
c2098f5 to
446f61e
Compare
Split into:
|
| { | ||
| log_message(MTC_LOG_WARNING, "COM: pthread_rwlock_destroy failed (sys %d).\n", pthread_ret); | ||
| } | ||
| pthread_ret = pthread_mutex_destroy(&object->thread_id_record_table_mutex); |
Check warning
Code scanning / CodeChecker
Value stored to 'pthread_ret' is never read Warning
| } | ||
|
|
||
| struct timespec timeout_ts = mstots(timeout); | ||
| clock_gettime(CLOCK_REALTIME, &deadline); |
Check warning
Code scanning / CodeChecker
the value returned by this function should not be disregarded; neglecting it may lead to errors Warning
Might need splitting into separate PRs (there are about 8 independent fixes here). For now keep them together until I test them.