Conversation
- Save timer type in swifthal_timer_start so oneshot cancellation works - Call dispatch_resume in swifthal_timer_start so the timer actually fires - Resume the source in swifthal_timer_close before releasing to avoid crashing when releasing a suspended dispatch source Amp-Thread-ID: https://ampcode.com/threads/T-019d0869-5a22-779b-b3d6-76212f36411e Co-authored-by: Amp <amp@ampcode.com>
fwrite(buf, size, 1) and fread(buf, size, 1) return 1 on success rather than the actual byte count, and partial reads are silently lost. Swap to fwrite(buf, 1, size) and fread(buf, 1, size) so the return value reflects the actual number of bytes transferred. Amp-Thread-ID: https://ampcode.com/threads/T-019d0869-5a22-779b-b3d6-76212f36411e Co-authored-by: Amp <amp@ampcode.com>
- Create threads detached so resources are reclaimed on exit - swifthal_timeout_to_timespec now computes an absolute CLOCK_REALTIME deadline as required by mq_timedsend, mq_timedreceive, sem_timedwait, and pthread_mutex_timedlock (previously used a relative time which caused all timed waits to expire immediately) - swifthal_os_sem_reset: handle EAGAIN from sem_trywait gracefully instead of treating a concurrent race as a fatal error Amp-Thread-ID: https://ampcode.com/threads/T-019d0869-5a22-779b-b3d6-76212f36411e Co-authored-by: Amp <amp@ampcode.com>
- swifthal_hwcycle_get on x86: return only the low 32 bits (a) instead of constructing a 64-bit value that gets silently truncated - swifthal_hwcycle_to_ns: use clock_getres(CLOCK_MONOTONIC) to compute a meaningful cycle-to-nanosecond conversion instead of returning the unrelated sysconf(_SC_CLK_TCK) value Amp-Thread-ID: https://ampcode.com/threads/T-019d0869-5a22-779b-b3d6-76212f36411e Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.