From 5be4065baf15abbdbefe69026deddbd861029daf Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 28 Feb 2019 09:36:19 +0100 Subject: [PATCH] make FixedIndexReader Send and update comments Signed-off-by: Wolfgang Bumiller --- src/backup/dynamic_index.rs | 3 ++- src/backup/fixed_index.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backup/dynamic_index.rs b/src/backup/dynamic_index.rs index a5ac821e..3a9b8beb 100644 --- a/src/backup/dynamic_index.rs +++ b/src/backup/dynamic_index.rs @@ -36,7 +36,8 @@ pub struct DynamicIndexReader { pub ctime: u64, } -// fixme: ???!!! +// `index` is mmap()ed which cannot be thread-local so should be sendable +// FIXME: Introduce an mmap wrapper type for this? unsafe impl Send for DynamicIndexReader {} impl Drop for DynamicIndexReader { diff --git a/src/backup/fixed_index.rs b/src/backup/fixed_index.rs index 1dc69587..d41601db 100644 --- a/src/backup/fixed_index.rs +++ b/src/backup/fixed_index.rs @@ -36,6 +36,9 @@ pub struct FixedIndexReader { pub ctime: u64, } +// `index` is mmap()ed which cannot be thread-local so should be sendable +unsafe impl Send for FixedIndexReader {} + impl Drop for FixedIndexReader { fn drop(&mut self) {