thread/Mutex: use using
instead of making it a derived class
Prepare the transition to std::mutex.
This commit is contained in:
parent
1b5c1f75a4
commit
0a0cc66e8f
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2018 The Music Player Daemon Project
|
||||
* Copyright 2003-2019 The Music Player Daemon Project
|
||||
* http://www.musicpd.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -21,8 +21,8 @@
|
||||
#define MPD_ARCHIVE_FILE_HXX
|
||||
|
||||
#include "input/Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
class Mutex;
|
||||
class ArchiveVisitor;
|
||||
|
||||
class ArchiveFile {
|
||||
|
@ -21,10 +21,10 @@
|
||||
#define MPD_INPUT_PLUGIN_HXX
|
||||
|
||||
#include "Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
struct ConfigBlock;
|
||||
class Mutex;
|
||||
class EventLoop;
|
||||
class RemoteTagScanner;
|
||||
class RemoteTagHandler;
|
||||
|
@ -21,9 +21,9 @@
|
||||
#define MPD_INPUT_LOCAL_OPEN_HXX
|
||||
|
||||
#include "Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
class Path;
|
||||
class Mutex;
|
||||
|
||||
/**
|
||||
* Open a "local" file. This is a wrapper for the input plugins
|
||||
|
@ -21,9 +21,9 @@
|
||||
#define MPD_INPUT_ARCHIVE_HXX
|
||||
|
||||
#include "input/Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
class Path;
|
||||
class Mutex;
|
||||
|
||||
InputStreamPtr
|
||||
OpenArchiveInputStream(Path path, Mutex &mutex);
|
||||
|
@ -21,12 +21,11 @@
|
||||
#define MPD_INPUT_CURL_HXX
|
||||
|
||||
#include "input/Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
class Mutex;
|
||||
|
||||
extern const struct InputPlugin input_plugin_curl;
|
||||
|
||||
/**
|
||||
|
@ -21,9 +21,9 @@
|
||||
#define MPD_INPUT_FILE_HXX
|
||||
|
||||
#include "input/Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
class Path;
|
||||
class Mutex;
|
||||
|
||||
InputStreamPtr
|
||||
OpenFileInputStream(Path path, Mutex &mutex);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2017 Max Kellermann <max.kellermann@gmail.com>
|
||||
* Copyright 2008-2019 Max Kellermann <max.kellermann@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -30,7 +30,8 @@
|
||||
#ifndef CURL_INIT_HXX
|
||||
#define CURL_INIT_HXX
|
||||
|
||||
class Mutex;
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
class EventLoop;
|
||||
class CurlGlobal;
|
||||
|
||||
|
@ -18,6 +18,5 @@
|
||||
*/
|
||||
|
||||
#include "Mutex.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
Mutex smbclient_mutex;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#ifndef MPD_SMBCLIENT_MUTEX_HXX
|
||||
#define MPD_SMBCLIENT_MUTEX_HXX
|
||||
|
||||
class Mutex;
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
/**
|
||||
* Since libsmbclient is not thread-safe, this mutex must be locked
|
||||
|
@ -45,7 +45,6 @@ struct FilteredAudioOutput;
|
||||
struct MusicChunk;
|
||||
struct ConfigBlock;
|
||||
class MusicPipe;
|
||||
class Mutex;
|
||||
class Mixer;
|
||||
class AudioOutputClient;
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "ReplayGainMode.hxx"
|
||||
#include "pcm/PcmBuffer.hxx"
|
||||
#include "pcm/PcmDither.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "util/ConstBuffer.hxx"
|
||||
|
||||
#include <utility>
|
||||
@ -36,7 +37,6 @@
|
||||
|
||||
struct MusicChunk;
|
||||
struct Tag;
|
||||
class Mutex;
|
||||
class Filter;
|
||||
class PreparedFilter;
|
||||
|
||||
|
@ -20,11 +20,11 @@
|
||||
#ifndef MPD_PLAYLIST_ANY_HXX
|
||||
#define MPD_PLAYLIST_ANY_HXX
|
||||
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "config.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class Mutex;
|
||||
class SongEnumerator;
|
||||
class Storage;
|
||||
|
||||
|
@ -20,11 +20,11 @@
|
||||
#ifndef MPD_PLAYLIST_MAPPER_HXX
|
||||
#define MPD_PLAYLIST_MAPPER_HXX
|
||||
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "config.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class Mutex;
|
||||
class SongEnumerator;
|
||||
class Storage;
|
||||
|
||||
|
@ -21,10 +21,10 @@
|
||||
#define MPD_PLAYLIST_PLUGIN_HXX
|
||||
|
||||
#include "input/Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
struct ConfigBlock;
|
||||
struct Tag;
|
||||
class Mutex;
|
||||
class SongEnumerator;
|
||||
|
||||
struct playlist_plugin {
|
||||
|
@ -21,10 +21,10 @@
|
||||
#define MPD_PLAYLIST_REGISTRY_HXX
|
||||
|
||||
#include "input/Ptr.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
struct ConfigData;
|
||||
class Mutex;
|
||||
class SongEnumerator;
|
||||
|
||||
extern const struct playlist_plugin *const playlist_plugins[];
|
||||
|
@ -20,11 +20,11 @@
|
||||
#ifndef MPD_PLAYLIST_STREAM_HXX
|
||||
#define MPD_PLAYLIST_STREAM_HXX
|
||||
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class Mutex;
|
||||
class SongEnumerator;
|
||||
class Path;
|
||||
|
||||
|
@ -25,12 +25,11 @@
|
||||
#ifndef MPD_AIFF_HXX
|
||||
#define MPD_AIFF_HXX
|
||||
|
||||
#include <mutex>
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
class InputStream;
|
||||
class Mutex;
|
||||
|
||||
/**
|
||||
* Seeks the AIFF file to the ID3 chunk.
|
||||
|
@ -25,11 +25,10 @@
|
||||
#ifndef MPD_RIFF_HXX
|
||||
#define MPD_RIFF_HXX
|
||||
|
||||
#include <mutex>
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
class Mutex;
|
||||
class InputStream;
|
||||
|
||||
/**
|
||||
|
@ -35,12 +35,12 @@
|
||||
#ifdef _WIN32
|
||||
|
||||
#include "CriticalSection.hxx"
|
||||
class Mutex : public CriticalSection {};
|
||||
using Mutex = CriticalSection;
|
||||
|
||||
#else
|
||||
|
||||
#include "PosixMutex.hxx"
|
||||
class Mutex : public PosixMutex {};
|
||||
using Mutex = PosixMutex;
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user