Request a share mode of both reading and writing for RandomAccessFile open.

This change allows reading and writing to happen concurrently on the
file on Windows.
This commit is contained in:
Dain 2012-01-19 15:10:45 -07:00
parent 70408ea717
commit a6753c3dc3

View File

@ -178,7 +178,8 @@ inline Mapping*
map(JNIEnv* e, string_t path)
{
Mapping* result = 0;
HANDLE file = CreateFileW(path, FILE_READ_DATA, FILE_SHARE_READ, 0,
HANDLE file = CreateFileW(path, FILE_READ_DATA,
FILE_SHARE_READ | FILE_SHARE_WRITE, 0,
OPEN_EXISTING, 0, 0);
if (file != INVALID_HANDLE_VALUE) {
unsigned size = GetFileSize(file, 0);