mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-22 16:06:30 -05:00
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:
parent
80476c480b
commit
fcf7c44197
3 changed files with 323 additions and 161 deletions
|
|
@ -129,6 +129,18 @@ int sopen_multi_file(STREAM* s, unsigned i, const char* file)
|
|||
return 0;
|
||||
}
|
||||
|
||||
STREAM* sopen_write(const char* file)
|
||||
{
|
||||
STREAM* s = sopen_multi_write(1);
|
||||
|
||||
if (sopen_multi_file(s, 0, file) != 0) {
|
||||
sclose(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int sclose(STREAM* s)
|
||||
{
|
||||
int fail = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue