Lines Matching full:flag

106   flag_properties t; /**< "Type" of the flag in loc */
138 /*! Base class for wait/release volatile flag */
143 PtrType checker; /**< When flag==checker, it has been released. */
165 /*! @result true if the flag object has been released. */
173 /*! @param old_loc in old value of flag
174 * @result true if the flag's old value indicates it was released. */
176 /*! @result true if the flag object is not yet released.
179 * while (flag.notdone_check()) { pause(); }
184 /*! @result Actual flag value before release was applied.
185 * Trigger all waiting threads to run by modifying flag to release state. */
189 /*! @result Actual flag value before sleep bit(s) set.
190 * Notes that there is at least one thread sleeping on the flag by setting
200 /*! @result Actual flag value before sleep bit(s) cleared.
201 * Notes that there are no longer threads sleeping on the flag by clearing
211 /*! @param old_loc in old value of flag
212 * Test if there are threads sleeping on the flag's old value in old_loc. */
218 /*! Test whether there are threads sleeping on the flag. */
232 /*! Base class for wait/release atomic flag */
236 std::atomic<PtrType> *loc; /**< Pointer to flag location to wait on */
237 PtrType checker; /**< Flag == checker means it has been released. */
250 /*! @result the pointer to the actual flag */
252 /*! @result void* pointer to the actual flag */
256 /*! @result flag value */
258 /*! @param val the new flag value to be stored */
260 /*! @result true if the flag object has been released. */
267 /*! @param old_loc in old value of flag
268 * @result true if the flag's old value indicates it was released. */
270 /*! @result true if the flag object is not yet released.
273 * while (flag.notdone_check()) { pause(); }
276 /*! @result Actual flag value before release was applied.
277 * Trigger all waiting threads to run by modifying flag to release state. */
279 /*! @result Actual flag value before sleep bit(s) set.
280 * Notes that there is at least one thread sleeping on the flag by setting
289 /*! @result Actual flag value before sleep bit(s) cleared.
290 * Notes that there are no longer threads sleeping on the flag by clearing
299 /*! @param old_loc in old value of flag
300 * Test whether there are threads sleeping on flag's old value in old_loc. */
306 /*! Test whether there are threads sleeping on the flag. */
369 C *flag USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
371 volatile void *spin = flag->get();
385 if (flag->done_check()) {
400 ("__kmp_wait_sleep: T#%d waiting for flag(%p)\n", th_gtid, flag));
529 while (flag->notdone_check()) {
543 flag->execute_tasks(
636 flag->mwait(th_gtid);
644 flag->suspend(th_gtid);
710 // Set up a monitor on the flag variable causing the calling thread to wait in
711 // a less active state until the flag variable is modified.
713 static inline void __kmp_mwait_template(int th_gtid, C *flag) {
717 KF_TRACE(30, ("__kmp_mwait_template: T#%d enter for flag = %p\n", th_gtid,
718 flag->get()));
726 volatile void *spin = flag->get();
729 if (!flag->done_check()) {
737 flag->set_sleeping();
748 // To avoid a race, check flag between 'monitor' and 'mwait'. A write to
751 if (flag->done_check())
752 flag->unset_sleeping();
754 // if flag changes here, wake-up happens immediately
755 TCW_PTR(th->th.th_sleep_loc, (void *)flag);
756 th->th.th_sleep_loc_type = flag->get_type();
771 if (flag->is_sleeping())
772 flag->unset_sleeping();
782 } // Drop out to main wait loop to check flag, handle tasks, etc.
788 /* Release any threads specified as waiting on the flag by releasing the flag
792 template <class C> static inline void __kmp_release_template(C *flag) {
796 KF_TRACE(20, ("__kmp_release: T#%d releasing flag(%x)\n", gtid, flag->get()));
797 KMP_DEBUG_ASSERT(flag->get());
798 KMP_FSYNC_RELEASING(flag->get_void_p());
800 flag->internal_release();
802 KF_TRACE(100, ("__kmp_release: T#%d set new spin=%d\n", gtid, flag->get(),
803 flag->load()));
807 // Are *any* threads waiting on flag sleeping?
808 if (flag->is_any_sleeping()) {
809 for (unsigned int i = 0; i < flag->get_num_waiters(); ++i) {
810 // if sleeping waiter exists at i, sets current_waiter to i inside flag
811 kmp_info_t *waiter = flag->get_waiter(i);
816 "flag(%p) set\n",
817 gtid, wait_gtid, flag->get()));
818 flag->resume(wait_gtid); // unsets flag's current_waiter when done
935 kmp_uint32 offset; /**< Portion of flag of interest for an operation. */
936 bool flag_switch; /**< Indicates a switch in flag location. */
938 kmp_info_t *this_thr; /**< Thread to redirect to different flag location. */
940 void *itt_sync_obj; /**< ITT object to pass to new flag location. */
975 kmp_flag_64<> flag(&this_thr->th.th_bar[bt].bb.b_go,
977 __kmp_wait_64(this_thr, &flag, TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
1027 void *flag = CCAST(void *, thr->th.th_sleep_loc);
1029 if (!flag)
1034 __kmp_resume_32(gtid, RCAST(kmp_flag_32<> *, flag));
1037 __kmp_resume_64(gtid, RCAST(kmp_flag_64<> *, flag));
1040 __kmp_atomic_resume_64(gtid, RCAST(kmp_atomic_flag_64<> *, flag));
1043 __kmp_resume_oncore(gtid, RCAST(kmp_flag_oncore *, flag));
1046 KF_TRACE(100, ("__kmp_null_resume_wrapper: flag type %d is unset\n", type));