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
c9ba4f3f
Commit
c9ba4f3f
authored
Feb 05, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/List: add RAII class
parent
c0e9246a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
22 deletions
+25
-22
Main.cxx
src/Main.cxx
+2
-4
ArchiveList.hxx
src/archive/ArchiveList.hxx
+11
-0
dump_text_file.cxx
test/dump_text_file.cxx
+4
-6
run_input.cxx
test/run_input.cxx
+4
-6
visit_archive.cxx
test/visit_archive.cxx
+4
-6
No files found.
src/Main.cxx
View file @
c9ba4f3f
...
...
@@ -529,7 +529,7 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
initPermissions
(
raw_config
);
spl_global_init
(
raw_config
);
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
()
;
const
ScopeArchivePluginsInit
archive_plugins_init
;
#endif
pcm_convert_global_init
(
raw_config
);
...
...
@@ -671,9 +671,7 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
instance
->
FinishShutdownPartitions
();
command_finish
();
decoder_plugin_deinit_all
();
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all
();
#endif
instance
->
rtio_thread
.
Stop
();
instance
->
io_thread
.
Stop
();
...
...
src/archive/ArchiveList.hxx
View file @
c9ba4f3f
...
...
@@ -46,4 +46,15 @@ archive_plugin_init_all();
void
archive_plugin_deinit_all
()
noexcept
;
class
ScopeArchivePluginsInit
{
public
:
ScopeArchivePluginsInit
()
{
archive_plugin_init_all
();
}
~
ScopeArchivePluginsInit
()
noexcept
{
archive_plugin_deinit_all
();
}
};
#endif
test/dump_text_file.cxx
View file @
c9ba4f3f
...
...
@@ -38,21 +38,19 @@
class
GlobalInit
{
EventThread
io_thread
;
#ifdef ENABLE_ARCHIVE
const
ScopeArchivePluginsInit
archive_plugins_init
;
#endif
public
:
GlobalInit
()
{
io_thread
.
Start
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
ConfigData
(),
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
input_stream_global_finish
();
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all
();
#endif
}
};
...
...
test/run_input.cxx
View file @
c9ba4f3f
...
...
@@ -106,6 +106,10 @@ class GlobalInit {
ConfigData
config
;
EventThread
io_thread
;
#ifdef ENABLE_ARCHIVE
const
ScopeArchivePluginsInit
archive_plugins_init
;
#endif
public
:
GlobalInit
(
Path
config_path
,
bool
verbose
)
{
SetLogThreshold
(
verbose
?
LogLevel
::
DEBUG
:
LogLevel
::
INFO
);
...
...
@@ -117,18 +121,12 @@ public:
io_thread
.
Start
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
config
,
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
input_stream_global_finish
();
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all
();
#endif
}
};
...
...
test/visit_archive.cxx
View file @
c9ba4f3f
...
...
@@ -38,21 +38,19 @@
class
GlobalInit
{
EventThread
io_thread
;
#ifdef ENABLE_ARCHIVE
const
ScopeArchivePluginsInit
archive_plugins_init
;
#endif
public
:
GlobalInit
()
{
io_thread
.
Start
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
ConfigData
(),
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
input_stream_global_finish
();
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all
();
#endif
}
};
...
...
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