@@ -104,7 +104,8 @@ template <> struct flag_traits<flag_oncore> {
104104template <flag_type FlagType> class kmp_flag {
105105protected:
106106 flag_properties t; /* *< "Type" of the flag in loc */
107- kmp_info_t *waiting_threads[1 ]; /* *< Threads sleeping on this thread. */
107+ /* *< Threads sleeping on this thread. */
108+ kmp_info_t *waiting_threads[1 ] = {nullptr };
108109 kmp_uint32 num_waiting_threads; /* *< Num threads sleeping on this thread. */
109110 std::atomic<bool > *sleepLoc;
110111
@@ -140,7 +141,7 @@ template <typename PtrType, flag_type FlagType, bool Sleepable>
140141class kmp_flag_native : public kmp_flag <FlagType> {
141142protected:
142143 volatile PtrType *loc;
143- PtrType checker; /* *< When flag==checker, it has been released. */
144+ PtrType checker = (PtrType) 0 ; /* *< When flag==checker, it has been released */
144145 typedef flag_traits<FlagType> traits_type;
145146
146147public:
@@ -234,7 +235,7 @@ template <typename PtrType, flag_type FlagType, bool Sleepable>
234235class kmp_flag_atomic : public kmp_flag <FlagType> {
235236protected:
236237 std::atomic<PtrType> *loc; /* *< Pointer to flag location to wait on */
237- PtrType checker; /* *< Flag == checker means it has been released. */
238+ PtrType checker = (PtrType) 0 ; /* *< Flag== checker means it has been released */
238239public:
239240 typedef flag_traits<FlagType> traits_type;
240241 typedef PtrType flag_t ;
@@ -935,7 +936,8 @@ class kmp_flag_oncore : public kmp_flag_native<kmp_uint64, flag_oncore, false> {
935936 kmp_uint32 offset; /* *< Portion of flag of interest for an operation. */
936937 bool flag_switch; /* *< Indicates a switch in flag location. */
937938 enum barrier_type bt; /* *< Barrier type. */
938- kmp_info_t *this_thr; /* *< Thread to redirect to different flag location. */
939+ /* *< Thread to redirect to different flag location. */
940+ kmp_info_t *this_thr = nullptr ;
939941#if USE_ITT_BUILD
940942 void *itt_sync_obj; /* *< ITT object to pass to new flag location. */
941943#endif
0 commit comments