Remove ki_mutex.h and associated includes
REMOVED: ki_mutex.h since all mutexes now use std::mutex
This commit is contained in:
parent
9e6e9d0910
commit
f87754848e
|
@ -23,9 +23,6 @@ Newer C++ versions include features that make some of our current code unnecessa
|
||||||
This C++ standard version is already used by KiCad, but much code that pre-dates
|
This C++ standard version is already used by KiCad, but much code that pre-dates
|
||||||
the version switch exists and can be tidied.
|
the version switch exists and can be tidied.
|
||||||
|
|
||||||
* `MUTEX` can use [`std::mutex`](https://en.cppreference.com/w/cpp/thread/mutex)
|
|
||||||
and remove the Boost mutex dependency and the whole `ki_mutex.h` header in
|
|
||||||
favour of `<mutex>`.
|
|
||||||
* [`std::auto_ptr`](https://en.cppreference.com/w/cpp/memory/auto_ptr)
|
* [`std::auto_ptr`](https://en.cppreference.com/w/cpp/memory/auto_ptr)
|
||||||
should be changed to [`std::unique_ptr`](https://en.cppreference.com/w/cpp/memory/unique_ptr).
|
should be changed to [`std::unique_ptr`](https://en.cppreference.com/w/cpp/memory/unique_ptr).
|
||||||
`auto_ptr` is removed entirely in C++17.
|
`auto_ptr` is removed entirely in C++17.
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
|
|
||||||
#include <import_export.h>
|
#include <import_export.h>
|
||||||
#include <ki_exception.h>
|
#include <ki_exception.h>
|
||||||
#include <ki_mutex.h>
|
|
||||||
#include <kicad_string.h>
|
#include <kicad_string.h>
|
||||||
#include <sync_queue.h>
|
#include <sync_queue.h>
|
||||||
#include <lib_tree_item.h>
|
#include <lib_tree_item.h>
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
/*
|
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013-2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
||||||
* Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, you may find one here:
|
|
||||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
||||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
||||||
* or you may write to the Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef KI_MUTEX_H_
|
|
||||||
#define KI_MUTEX_H_
|
|
||||||
|
|
||||||
|
|
||||||
/// Establish KiCad MUTEX choices here in this file:
|
|
||||||
/// typedef MUTEX and typedef MUTLOCK.
|
|
||||||
///
|
|
||||||
/// Using an unnamed resource is easier, providing a textual name for a
|
|
||||||
/// constructor is cumbersome, so we make choice on that criteria mostly:
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
|
||||||
// This is a fine choice between the two, but requires linking to ${Boost_LIBRARIES}
|
|
||||||
|
|
||||||
#include <boost/interprocess/sync/interprocess_mutex.hpp>
|
|
||||||
#include <boost/interprocess/sync/scoped_lock.hpp>
|
|
||||||
|
|
||||||
typedef boost::interprocess::interprocess_mutex MUTEX;
|
|
||||||
typedef boost::interprocess::scoped_lock<MUTEX> MUTLOCK;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
// This choice also works.
|
|
||||||
|
|
||||||
#include <wx/thread.h>
|
|
||||||
|
|
||||||
typedef wxMutex MUTEX;
|
|
||||||
typedef wxMutexLocker MUTLOCK;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // KI_MUTEX_H_
|
|
Loading…
Reference in New Issue