Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
20894e2f
Commit
20894e2f
authored
20 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Convert the per-thread mutex list to a standard list.
parent
e8d1e2f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/mutex.c
+7
-12
7 additions, 12 deletions
server/mutex.c
server/thread.c
+1
-1
1 addition, 1 deletion
server/thread.c
server/thread.h
+1
-2
1 addition, 2 deletions
server/thread.h
with
9 additions
and
15 deletions
server/mutex.c
+
7
−
12
View file @
20894e2f
...
...
@@ -37,8 +37,7 @@ struct mutex
struct
thread
*
owner
;
/* mutex owner */
unsigned
int
count
;
/* recursion count */
int
abandoned
;
/* has it been abandoned? */
struct
mutex
*
next
;
struct
mutex
*
prev
;
struct
list
entry
;
/* entry in owner thread mutex list */
};
static
void
mutex_dump
(
struct
object
*
obj
,
int
verbose
);
...
...
@@ -71,7 +70,6 @@ static struct mutex *create_mutex( const WCHAR *name, size_t len, int owned )
mutex
->
count
=
0
;
mutex
->
owner
=
NULL
;
mutex
->
abandoned
=
0
;
mutex
->
next
=
mutex
->
prev
=
NULL
;
if
(
owned
)
mutex_satisfied
(
&
mutex
->
obj
,
current
);
}
}
...
...
@@ -83,19 +81,18 @@ static void do_release( struct mutex *mutex )
{
assert
(
!
mutex
->
count
);
/* remove the mutex from the thread list of owned mutexes */
if
(
mutex
->
next
)
mutex
->
next
->
prev
=
mutex
->
prev
;
if
(
mutex
->
prev
)
mutex
->
prev
->
next
=
mutex
->
next
;
else
mutex
->
owner
->
mutex
=
mutex
->
next
;
list_remove
(
&
mutex
->
entry
);
mutex
->
owner
=
NULL
;
mutex
->
next
=
mutex
->
prev
=
NULL
;
wake_up
(
&
mutex
->
obj
,
0
);
}
void
abandon_mutexes
(
struct
thread
*
thread
)
{
while
(
thread
->
mutex
)
struct
list
*
ptr
;
while
((
ptr
=
list_head
(
&
thread
->
mutex_list
))
!=
NULL
)
{
struct
mutex
*
mutex
=
thread
->
mutex
;
struct
mutex
*
mutex
=
LIST_ENTRY
(
ptr
,
struct
mutex
,
entry
)
;
assert
(
mutex
->
owner
==
thread
);
mutex
->
count
=
0
;
mutex
->
abandoned
=
1
;
...
...
@@ -129,9 +126,7 @@ static int mutex_satisfied( struct object *obj, struct thread *thread )
{
assert
(
!
mutex
->
owner
);
mutex
->
owner
=
thread
;
mutex
->
prev
=
NULL
;
if
((
mutex
->
next
=
thread
->
mutex
))
mutex
->
next
->
prev
=
mutex
;
thread
->
mutex
=
mutex
;
list_add_head
(
&
thread
->
mutex_list
,
&
mutex
->
entry
);
}
if
(
!
mutex
->
abandoned
)
return
0
;
mutex
->
abandoned
=
0
;
...
...
This diff is collapsed.
Click to expand it.
server/thread.c
+
1
−
1
View file @
20894e2f
...
...
@@ -115,7 +115,6 @@ inline static void init_thread_structure( struct thread *thread )
thread
->
unix_tid
=
-
1
;
/* not known yet */
thread
->
context
=
NULL
;
thread
->
teb
=
NULL
;
thread
->
mutex
=
NULL
;
thread
->
debug_ctx
=
NULL
;
thread
->
debug_event
=
NULL
;
thread
->
queue
=
NULL
;
...
...
@@ -139,6 +138,7 @@ inline static void init_thread_structure( struct thread *thread )
thread
->
creation_time
=
time
(
NULL
);
thread
->
exit_time
=
0
;
list_init
(
&
thread
->
mutex_list
);
list_init
(
&
thread
->
system_apc
);
list_init
(
&
thread
->
user_apc
);
...
...
This diff is collapsed.
Click to expand it.
server/thread.h
+
1
−
2
View file @
20894e2f
...
...
@@ -29,7 +29,6 @@
struct
process
;
struct
thread_wait
;
struct
thread_apc
;
struct
mutex
;
struct
debug_ctx
;
struct
debug_event
;
struct
msg_queue
;
...
...
@@ -57,7 +56,7 @@ struct thread
struct
thread
*
proc_prev
;
struct
process
*
process
;
thread_id_t
id
;
/* thread id */
struct
mutex
*
mutex
;
/* list of currently owned mutexes */
struct
list
mutex
_list
;
/* list of currently owned mutexes */
struct
debug_ctx
*
debug_ctx
;
/* debugger context if this thread is a debugger */
struct
debug_event
*
debug_event
;
/* debug event being sent to debugger */
struct
msg_queue
*
queue
;
/* message queue */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment