Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d7ef680e
Commit
d7ef680e
authored
Jul 13, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use a pthread mutex for the drive info section.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3b745f17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
file.c
dlls/ntdll/unix/file.c
+3
-2
No files found.
dlls/ntdll/unix/file.c
View file @
d7ef680e
...
...
@@ -1871,13 +1871,14 @@ static NTSTATUS server_get_file_info( HANDLE handle, IO_STATUS_BLOCK *io, void *
/* retrieve device/inode number for all the drives */
static
unsigned
int
get_drives_info
(
struct
file_identity
info
[
MAX_DOS_DRIVES
]
)
{
static
pthread_mutex_t
cache_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
struct
file_identity
cache
[
MAX_DOS_DRIVES
];
static
time_t
last_update
;
static
unsigned
int
nb_drives
;
unsigned
int
ret
;
time_t
now
=
time
(
NULL
);
RtlEnterCriticalSection
(
&
dir_section
);
pthread_mutex_lock
(
&
cache_mutex
);
if
(
now
!=
last_update
)
{
char
*
buffer
,
*
p
;
...
...
@@ -1912,7 +1913,7 @@ static unsigned int get_drives_info( struct file_identity info[MAX_DOS_DRIVES] )
}
memcpy
(
info
,
cache
,
sizeof
(
cache
)
);
ret
=
nb_drives
;
RtlLeaveCriticalSection
(
&
dir_section
);
pthread_mutex_unlock
(
&
cache_mutex
);
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment