File tree Expand file tree Collapse file tree 2 files changed +13
-16
lines changed Expand file tree Collapse file tree 2 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,11 @@ class ThreadArgs
7373 Routine routine;
7474 Arg arg;
7575public:
76- ThreadArgs (Routine r, Arg a) : routine (r), arg (a) { }
77- ThreadArgs (const ThreadArgs& t) : routine (t.routine ), arg (t.arg ) { }
76+ ThreadArgs (Routine r, Arg a) noexcept : routine (r), arg (a) { }
77+ ThreadArgs (const ThreadArgs& t) noexcept : routine (t.routine ), arg (t.arg ) { }
78+ ThreadArgs& operator =(const ThreadArgs&) = delete ;
79+
7880 void run () { routine (arg); }
79- private:
80- ThreadArgs& operator =(const ThreadArgs&);
8181};
8282
8383#ifdef __cplusplus
Original file line number Diff line number Diff line change 4040
4141// Thread priorities (may be ignored)
4242
43- const int THREAD_high = 1 ;
44- const int THREAD_medium_high = 2 ;
45- const int THREAD_medium = 3 ;
46- const int THREAD_medium_low = 4 ;
47- const int THREAD_low = 5 ;
48- const int THREAD_critical = 6 ;
43+ inline constexpr int THREAD_high = 1 ;
44+ inline constexpr int THREAD_medium_high = 2 ;
45+ inline constexpr int THREAD_medium = 3 ;
46+ inline constexpr int THREAD_medium_low = 4 ;
47+ inline constexpr int THREAD_low = 5 ;
48+ inline constexpr int THREAD_critical = 6 ;
4949
5050
5151// Thread startup
@@ -90,17 +90,14 @@ class Thread
9090 static bool isCurrent (Handle threadHandle);
9191 bool isCurrent ();
9292
93- Thread ()
94- {
95- memset (&internalId, 0 , sizeof (internalId));
96- }
93+ Thread () noexcept { }
9794
9895private:
99- Thread (InternalId iid)
96+ Thread (InternalId iid) noexcept
10097 : internalId(iid)
10198 { }
10299
103- InternalId internalId;
100+ InternalId internalId{} ;
104101};
105102
106103inline ThreadId getThreadId ()
You can’t perform that action at this time.
0 commit comments