rtos Thread: Remove private copy constructor and assignment operators in favor of the NonCopyable traits.

pull/4689/head
Vincent Coubard 2017-06-20 13:01:28 +01:00 committed by adbridge
parent 45163dd8b4
commit b1c5ca682b
1 changed files with 2 additions and 5 deletions

View File

@ -29,6 +29,7 @@
#include "mbed_rtx_conf.h" #include "mbed_rtx_conf.h"
#include "platform/Callback.h" #include "platform/Callback.h"
#include "platform/mbed_toolchain.h" #include "platform/mbed_toolchain.h"
#include "platform/NonCopyable.h"
#include "rtos/Semaphore.h" #include "rtos/Semaphore.h"
#include "rtos/Mutex.h" #include "rtos/Mutex.h"
@ -69,7 +70,7 @@ namespace rtos {
* and underlying RTOS objects (static or dynamic RTOS memory pools are not being used). * and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).
* Additionally the stack memory for this thread will be allocated on the heap, if it wasn't supplied to the constructor. * Additionally the stack memory for this thread will be allocated on the heap, if it wasn't supplied to the constructor.
*/ */
class Thread { class Thread : private mbed::NonCopyable<Thread> {
public: public:
/** Allocate a new thread without starting execution /** Allocate a new thread without starting execution
@param priority initial priority of the thread function. (default: osPriorityNormal). @param priority initial priority of the thread function. (default: osPriorityNormal).
@ -348,10 +349,6 @@ public:
virtual ~Thread(); virtual ~Thread();
private: private:
/* disallow copy constructor and assignment operators */
Thread(const Thread&);
Thread& operator=(const Thread&);
// Required to share definitions without // Required to share definitions without
// delegated constructors // delegated constructors
void constructor(osPriority priority=osPriorityNormal, void constructor(osPriority priority=osPriorityNormal,