| 853 | } |
| 854 | |
| 855 | int add_with_suspend3(void* meta, bthread::TaskIterator<LongIntTask>& iter) { |
| 856 | int64_t* result = (int64_t*)meta; |
| 857 | if (iter.is_queue_stopped()) { |
| 858 | stopped = true; |
| 859 | return 0; |
| 860 | } |
| 861 | for (; iter; ++iter) { |
| 862 | if (iter->value == -100) { |
| 863 | g_suspending = true; |
| 864 | while (g_suspending) { |
| 865 | usleep(10); |
| 866 | } |
| 867 | if (iter->event) { iter->event->signal(); } |
| 868 | } else { |
| 869 | *result += iter->value; |
| 870 | if (iter->event) { iter->event->signal(); } |
| 871 | } |
| 872 | } |
| 873 | return 0; |
| 874 | } |
| 875 | |
| 876 | void test_cancel_unexecuted_high_priority_task(bool use_pthread) { |
| 877 | g_should_be_urgent = false; |
nothing calls this directly
no test coverage detected