Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3146bf51
Commit
3146bf51
authored
Mar 05, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/update/Service: eliminate attribute "progress"
Use walk!=nullptr instead.
parent
b24a5e06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
15 deletions
+1
-15
Service.cxx
src/db/update/Service.cxx
+1
-7
Service.hxx
src/db/update/Service.hxx
+0
-8
No files found.
src/db/update/Service.cxx
View file @
3146bf51
...
...
@@ -45,7 +45,6 @@ UpdateService::UpdateService(EventLoop &_loop, SimpleDatabase &_db,
:
DeferredMonitor
(
_loop
),
db
(
_db
),
storage
(
_storage
),
listener
(
_listener
),
progress
(
UPDATE_PROGRESS_IDLE
),
update_task_id
(
0
),
walk
(
nullptr
)
{
...
...
@@ -140,7 +139,6 @@ UpdateService::Task()
else
LogDebug
(
update_domain
,
"finished"
);
progress
=
UPDATE_PROGRESS_DONE
;
DeferredMonitor
::
Schedule
();
}
...
...
@@ -157,7 +155,6 @@ UpdateService::StartThread(UpdateQueueItem &&i)
assert
(
GetEventLoop
().
IsInsideOrNull
());
assert
(
walk
==
nullptr
);
progress
=
UPDATE_PROGRESS_RUNNING
;
modified
=
false
;
next
=
std
::
move
(
i
);
...
...
@@ -231,7 +228,7 @@ UpdateService::Enqueue(const char *path, bool discard)
happen */
return
0
;
if
(
progress
!=
UPDATE_PROGRESS_IDLE
)
{
if
(
walk
!=
nullptr
)
{
const
unsigned
id
=
GenerateId
();
if
(
!
queue
.
Push
(
*
db2
,
*
storage2
,
path
,
discard
,
id
))
return
0
;
...
...
@@ -254,7 +251,6 @@ UpdateService::Enqueue(const char *path, bool discard)
void
UpdateService
::
RunDeferred
()
{
assert
(
progress
==
UPDATE_PROGRESS_DONE
);
assert
(
next
.
IsDefined
());
assert
(
walk
!=
nullptr
);
...
...
@@ -278,7 +274,5 @@ UpdateService::RunDeferred()
if
(
i
.
IsDefined
())
{
/* schedule the next path */
StartThread
(
std
::
move
(
i
));
}
else
{
progress
=
UPDATE_PROGRESS_IDLE
;
}
}
src/db/update/Service.hxx
View file @
3146bf51
...
...
@@ -35,19 +35,11 @@ class CompositeStorage;
* This class manages the update queue and runs the update thread.
*/
class
UpdateService
final
:
DeferredMonitor
{
enum
Progress
{
UPDATE_PROGRESS_IDLE
=
0
,
UPDATE_PROGRESS_RUNNING
=
1
,
UPDATE_PROGRESS_DONE
=
2
};
SimpleDatabase
&
db
;
CompositeStorage
&
storage
;
DatabaseListener
&
listener
;
Progress
progress
;
bool
modified
;
Thread
update_thread
;
...
...
Write
Preview
Markdown
is supported
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