Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
829e6694
Commit
829e6694
authored
Jul 06, 2020
by
Zebediah Figura
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement NtReleaseMutant().
parent
2051acb1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
esync.c
dlls/ntdll/unix/esync.c
+34
-0
esync.h
dlls/ntdll/unix/esync.h
+1
-0
sync.c
dlls/ntdll/unix/sync.c
+3
-0
No files found.
dlls/ntdll/unix/esync.c
View file @
829e6694
...
...
@@ -424,6 +424,40 @@ NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access,
return
create_esync
(
ESYNC_MUTEX
,
handle
,
access
,
attr
,
initial
?
0
:
1
,
0
);
}
NTSTATUS
esync_release_mutex
(
HANDLE
*
handle
,
LONG
*
prev
)
{
struct
esync
*
obj
;
struct
mutex
*
mutex
;
static
const
uint64_t
value
=
1
;
NTSTATUS
ret
;
TRACE
(
"%p, %p.
\n
"
,
handle
,
prev
);
if
((
ret
=
get_object
(
handle
,
&
obj
)))
return
ret
;
mutex
=
obj
->
shm
;
/* This is thread-safe, because the only thread that can change the tid to
* or from our tid is ours. */
if
(
mutex
->
tid
!=
GetCurrentThreadId
())
return
STATUS_MUTANT_NOT_OWNED
;
if
(
prev
)
*
prev
=
mutex
->
count
;
mutex
->
count
--
;
if
(
!
mutex
->
count
)
{
/* This is also thread-safe, as long as signaling the file is the last
* thing we do. Other threads don't care about the tid if it isn't
* theirs. */
mutex
->
tid
=
0
;
if
(
write
(
obj
->
fd
,
&
value
,
sizeof
(
value
)
)
==
-
1
)
return
errno_to_status
(
errno
);
}
return
STATUS_SUCCESS
;
}
#define TICKSPERSEC 10000000
#define TICKSPERMSEC 10000
...
...
dlls/ntdll/unix/esync.h
View file @
829e6694
...
...
@@ -33,6 +33,7 @@ extern NTSTATUS esync_set_event( HANDLE handle ) DECLSPEC_HIDDEN;
extern
NTSTATUS
esync_create_mutex
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
BOOLEAN
initial
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
esync_release_mutex
(
HANDLE
*
handle
,
LONG
*
prev
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
esync_wait_objects
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOLEAN
wait_any
,
BOOLEAN
alertable
,
const
LARGE_INTEGER
*
timeout
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/sync.c
View file @
829e6694
...
...
@@ -609,6 +609,9 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count )
{
NTSTATUS
ret
;
if
(
do_esync
())
return
esync_release_mutex
(
handle
,
prev_count
);
SERVER_START_REQ
(
release_mutex
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
...
...
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