Use different thread when writing content file

This should reduce the possibility that the same
memory error is going to affect all the written
content files in the same way.
This commit is contained in:
Andrea Mazzoleni 2015-10-29 23:37:58 +01:00
parent 80476c480b
commit fcf7c44197
3 changed files with 323 additions and 161 deletions

View file

@ -54,12 +54,7 @@ typedef int64_t data_off_t;
struct snapraid_content {
char content[PATH_MAX]; /**< Path of the content file. */
uint64_t device; /**< Device identifier. */
uint32_t crc; /**< Expected crc. */
#if HAVE_PTHREAD_CREATE
pthread_t thread; /**< Thread used for verification. */
#else
void* retval; /**< Result of the verification. */
#endif
void* context; /**< Context used for multithread operations. */
tommy_node node; /**< Next node in the list. */
};