Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
d7419412
Commit
d7419412
authored
Jul 27, 2017
by
Pedro Gonnet
Browse files
don't hold the thread mutex while the calling thread is working.
parent
cb374bbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/threadpool.c
View file @
d7419412
...
...
@@ -309,7 +309,9 @@ void threadpool_map(struct threadpool *tp, threadpool_map_function map_function,
}
/* Do some work while I'm at it. */
pthread_mutex_unlock
(
&
tp
->
thread_mutex
);
threadpool_chomp
(
tp
,
tp
->
num_threads
-
1
);
pthread_mutex_lock
(
&
tp
->
thread_mutex
);
/* Wait for all threads to be done. */
while
(
tp
->
num_threads_waiting
<
tp
->
num_threads
-
1
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment