2013-12-09 18:09:58 +00:00
|
|
|
|
|
|
|
#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:
|
|
|
|
|
2013-12-09 18:48:42 +00:00
|
|
|
#if 1
|
2013-12-09 18:09:58 +00:00
|
|
|
|
|
|
|
// 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
|
|
|
|
|
2013-12-09 18:48:42 +00:00
|
|
|
// This choice also works.
|
|
|
|
|
2013-12-09 18:09:58 +00:00
|
|
|
#include <wx/thread.h>
|
|
|
|
|
|
|
|
typedef wxMutex MUTEX;
|
|
|
|
typedef wxMutexLocker MUTLOCK;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // KI_MUTEX_H_
|