Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
fef91699
Verified
Commit
fef91699
authored
7 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Discard tasks submitted during shutdown.
parent
235183a3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bramble-core/src/main/java/org/briarproject/bramble/system/SystemModule.java
+6
-2
6 additions, 2 deletions
...in/java/org/briarproject/bramble/system/SystemModule.java
with
6 additions
and
2 deletions
bramble-core/src/main/java/org/briarproject/bramble/system/SystemModule.java
+
6
−
2
View file @
fef91699
...
...
@@ -4,8 +4,9 @@ import org.briarproject.bramble.api.lifecycle.LifecycleManager;
import
org.briarproject.bramble.api.system.Clock
;
import
org.briarproject.bramble.api.system.Scheduler
;
import
java.util.concurrent.
Executors
;
import
java.util.concurrent.
RejectedExecutionHandler
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
javax.inject.Inject
;
import
javax.inject.Singleton
;
...
...
@@ -25,7 +26,10 @@ public class SystemModule {
private
final
ScheduledExecutorService
scheduler
;
public
SystemModule
()
{
scheduler
=
Executors
.
newSingleThreadScheduledExecutor
();
// Discard tasks that are submitted during shutdown
RejectedExecutionHandler
policy
=
new
ScheduledThreadPoolExecutor
.
DiscardPolicy
();
scheduler
=
new
ScheduledThreadPoolExecutor
(
1
,
policy
);
}
@Provides
...
...
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