Skip to content

Commit ab4da40

Browse files
committed
rtos: Prevent Thread class from being copied
Make the copy constructor and assignment operator private to prevent them from being used.
1 parent 05403d4 commit ab4da40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rtos/Thread.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ class Thread {
331331
virtual ~Thread();
332332

333333
private:
334+
/* disallow copy constructor and assignment operators */
335+
Thread(const Thread&);
336+
Thread& operator=(const Thread&);
337+
334338
// Required to share definitions without
335339
// delegated constructors
336340
void constructor(osPriority priority=osPriorityNormal,

0 commit comments

Comments
 (0)