Skip to content

Commit 3119c42

Browse files
committed
rtos Thread: Remove private copy constructor and assignment operators in favor of the NonCopyable traits.
1 parent 4d5f805 commit 3119c42

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

rtos/Thread.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "mbed_rtx_conf.h"
3030
#include "platform/Callback.h"
3131
#include "platform/mbed_toolchain.h"
32+
#include "platform/NonCopyable.h"
3233
#include "rtos/Semaphore.h"
3334
#include "rtos/Mutex.h"
3435

@@ -69,7 +70,7 @@ namespace rtos {
6970
* and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).
7071
* Additionally the stack memory for this thread will be allocated on the heap, if it wasn't supplied to the constructor.
7172
*/
72-
class Thread {
73+
class Thread : private mbed::NonCopyable<Thread> {
7374
public:
7475
/** Allocate a new thread without starting execution
7576
@param priority initial priority of the thread function. (default: osPriorityNormal).
@@ -348,10 +349,6 @@ class Thread {
348349
virtual ~Thread();
349350

350351
private:
351-
/* disallow copy constructor and assignment operators */
352-
Thread(const Thread&);
353-
Thread& operator=(const Thread&);
354-
355352
// Required to share definitions without
356353
// delegated constructors
357354
void constructor(osPriority priority=osPriorityNormal,

0 commit comments

Comments
 (0)