Skip to content
GitLab
Menu
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
4c6ca41f
Commit
4c6ca41f
authored
Aug 21, 2017
by
Matthieu Schaller
Browse files
Code formatting
parent
e6952cd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/scheduler.c
View file @
4c6ca41f
...
...
@@ -1377,7 +1377,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
if
(
qid
>=
s
->
nr_queues
)
error
(
"Bad computed qid."
);
/* If no previous owner, pick a random queue. */
if
(
qid
<
0
)
qid
=
rand_r
((
unsigned
int
*
)
pthread_getspecific
(
s
->
local_seed_pointer
)
)
%
s
->
nr_queues
;
if
(
qid
<
0
)
qid
=
rand_r
((
unsigned
int
*
)
pthread_getspecific
(
s
->
local_seed_pointer
))
%
s
->
nr_queues
;
/* Increase the waiting counter. */
atomic_inc
(
&
s
->
waiting
);
...
...
src/scheduler.h
View file @
4c6ca41f
...
...
@@ -103,6 +103,7 @@ struct scheduler {
/* The node we are working on. */
int
nodeID
;
/* 'Pointer' to the seed for the random number generator */
pthread_key_t
local_seed_pointer
;
};
...
...
Write
Preview
Supports
Markdown
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