memobj: synch prefetch among processes

This commit is contained in:
Balazs Gerofi
2016-12-18 13:46:46 +09:00
parent 5b7bcb7170
commit ff37ff9ccf
3 changed files with 32 additions and 6 deletions

View File

@ -1363,9 +1363,12 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot,
goto out;
}
if (memobj->flags & MF_PREFETCH) {
memobj_lock(memobj);
if (memobj->status == MEMOBJ_TO_BE_PREFETCHED) {
memobj->status = MEMOBJ_READY;
populated_mapping = 1;
}
memobj_unlock(memobj);
error = 0;
p = NULL;