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
be2a92d6
Commit
be2a92d6
authored
10 years ago
by
Abraham Kiggundu
Browse files
Options
Downloads
Patches
Plain Diff
Revert lock variable rename for clarity
parent
2933f1a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-desktop/src/org/briarproject/plugins/file/PollingRemovableDriveMonitor.java
+6
-6
6 additions, 6 deletions
...iarproject/plugins/file/PollingRemovableDriveMonitor.java
with
6 additions
and
6 deletions
briar-desktop/src/org/briarproject/plugins/file/PollingRemovableDriveMonitor.java
+
6
−
6
View file @
be2a92d6
...
...
@@ -22,8 +22,8 @@ class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
private
volatile
boolean
running
=
false
;
private
volatile
Callback
callback
=
null
;
private
final
Lock
synch
Lock
=
new
ReentrantLock
();
private
final
Condition
stopPolling
=
synch
Lock
.
newCondition
();
private
final
Lock
polling
Lock
=
new
ReentrantLock
();
private
final
Condition
stopPolling
=
polling
Lock
.
newCondition
();
public
PollingRemovableDriveMonitor
(
Executor
ioExecutor
,
...
...
@@ -41,12 +41,12 @@ class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
public
void
stop
()
throws
IOException
{
running
=
false
;
synch
Lock
.
lock
();
polling
Lock
.
lock
();
try
{
stopPolling
.
signalAll
();
}
finally
{
synch
Lock
.
unlock
();
polling
Lock
.
unlock
();
}
}
...
...
@@ -54,12 +54,12 @@ class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
try
{
Collection
<
File
>
drives
=
finder
.
findRemovableDrives
();
while
(
running
)
{
synch
Lock
.
lock
();
polling
Lock
.
lock
();
try
{
stopPolling
.
await
(
pollingInterval
,
TimeUnit
.
MILLISECONDS
);
}
finally
{
synch
Lock
.
unlock
();
polling
Lock
.
unlock
();
}
if
(!
running
)
return
;
Collection
<
File
>
newDrives
=
finder
.
findRemovableDrives
();
...
...
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