Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TeeTime-Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nelson Tavares de Sousa
TeeTime-Framework
Commits
c06ded45
Commit
c06ded45
authored
9 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
fixed concurrency bugs
parent
0f7ac177
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/teetime/framework/ThreadService.java
+8
-7
8 additions, 7 deletions
src/main/java/teetime/framework/ThreadService.java
with
8 additions
and
7 deletions
src/main/java/teetime/framework/ThreadService.java
+
8
−
7
View file @
c06ded45
package
teetime.framework
;
package
teetime.framework
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -23,12 +24,12 @@ class ThreadService extends AbstractService<ThreadService> {
...
@@ -23,12 +24,12 @@ class ThreadService extends AbstractService<ThreadService> {
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ThreadService
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ThreadService
.
class
);
private
final
List
<
Thread
>
consumerThreads
=
new
LinkedList
<
Thread
>();
private
final
List
<
Thread
>
consumerThreads
=
Collections
.
synchronizedList
(
new
LinkedList
<
Thread
>()
)
;
private
final
List
<
Thread
>
finiteProducerThreads
=
new
LinkedList
<
Thread
>();
private
final
List
<
Thread
>
finiteProducerThreads
=
Collections
.
synchronizedList
(
new
LinkedList
<
Thread
>()
)
;
private
final
List
<
Thread
>
infiniteProducerThreads
=
new
LinkedList
<
Thread
>();
private
final
List
<
Thread
>
infiniteProducerThreads
=
Collections
.
synchronizedList
(
new
LinkedList
<
Thread
>()
)
;
private
final
SignalingCounter
runnableCounter
=
new
SignalingCounter
();
private
final
SignalingCounter
runnableCounter
=
new
SignalingCounter
();
private
final
Set
<
Stage
>
threadableStages
=
new
HashSet
<
Stage
>();
private
final
Set
<
Stage
>
threadableStages
=
Collections
.
synchronizedSet
(
new
HashSet
<
Stage
>()
)
;
private
final
Configuration
configuration
;
private
final
Configuration
configuration
;
...
@@ -77,17 +78,17 @@ class ThreadService extends AbstractService<ThreadService> {
...
@@ -77,17 +78,17 @@ class ThreadService extends AbstractService<ThreadService> {
throw
new
IllegalStateException
(
"No stage was added using the addThreadableStage(..) method. Add at least one stage."
);
throw
new
IllegalStateException
(
"No stage was added using the addThreadableStage(..) method. Add at least one stage."
);
}
}
A2InvalidThreadAssignmentCheck
checker
=
new
A2InvalidThreadAssignmentCheck
(
t
hreadableStages
);
A2InvalidThreadAssignmentCheck
checker
=
new
A2InvalidThreadAssignmentCheck
(
newT
hreadableStages
);
checker
.
check
();
checker
.
check
();
A3PipeInstantiation
pipeVisitor
=
new
A3PipeInstantiation
();
A3PipeInstantiation
pipeVisitor
=
new
A3PipeInstantiation
();
traversor
=
new
Traverser
(
pipeVisitor
,
Direction
.
BOTH
);
traversor
=
new
Traverser
(
pipeVisitor
,
Direction
.
BOTH
);
traversor
.
traverse
(
startStage
);
traversor
.
traverse
(
startStage
);
A4StageAttributeSetter
attributeSetter
=
new
A4StageAttributeSetter
(
configuration
,
t
hreadableStages
);
A4StageAttributeSetter
attributeSetter
=
new
A4StageAttributeSetter
(
configuration
,
newT
hreadableStages
);
attributeSetter
.
setAttributes
();
attributeSetter
.
setAttributes
();
for
(
Stage
stage
:
t
hreadableStages
)
{
for
(
Stage
stage
:
newT
hreadableStages
)
{
categorizeThreadableStage
(
stage
);
categorizeThreadableStage
(
stage
);
}
}
...
...
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