tools/testing/selftests/sync/sync_merge.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/sync/sync_merge.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/sync/sync_merge.c- Extension
.c- Size
- 2195 bytes
- Lines
- 61
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
sync.hsw_sync.hsynctest.h
Detected Declarations
function files
Annotated Snippet
#include "sync.h"
#include "sw_sync.h"
#include "synctest.h"
int test_fence_merge_same_fence(void)
{
int fence, valid, merged;
int timeline = sw_sync_timeline_create();
valid = sw_sync_timeline_is_valid(timeline);
ASSERT(valid, "Failure allocating timeline\n");
fence = sw_sync_fence_create(timeline, "allocFence", 5);
valid = sw_sync_fence_is_valid(fence);
ASSERT(valid, "Failure allocating fence\n");
merged = sync_merge("mergeFence", fence, fence);
valid = sw_sync_fence_is_valid(fence);
ASSERT(valid, "Failure merging fence\n");
ASSERT(sync_fence_count_with_status(merged, FENCE_STATUS_SIGNALED) == 0,
"fence signaled too early!\n");
sw_sync_timeline_inc(timeline, 5);
ASSERT(sync_fence_count_with_status(merged, FENCE_STATUS_SIGNALED) == 1,
"fence did not signal!\n");
sw_sync_fence_destroy(merged);
sw_sync_fence_destroy(fence);
sw_sync_timeline_destroy(timeline);
return 0;
}
Annotation
- Immediate include surface: `sync.h`, `sw_sync.h`, `synctest.h`.
- Detected declarations: `function files`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.