|
|
|
|
|
|
|
|
assert(c.is_locked());
|
|
|
assert(c.is_locked());
|
|
|
|
|
|
|
|
|
++g_counter;
|
|
|
++g_counter;
|
|
|
//std::cout << "push:" << g_counter << " on " << idx << std::endl;
|
|
|
|
|
|
//co_await 5ms;
|
|
|
|
|
|
|
|
|
std::cout << "push:" << g_counter << " on " << idx << std::endl;
|
|
|
|
|
|
co_await 5ms;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert(c.is_locked());
|
|
|
assert(c.is_locked());
|
|
|
|
|
|
|
|
|
--g_counter;
|
|
|
--g_counter;
|
|
|
//std::cout << "pop :" << g_counter << " on " << idx << std::endl;
|
|
|
|
|
|
//co_await 5ms;
|
|
|
|
|
|
|
|
|
std::cout << "pop :" << g_counter << " on " << idx << std::endl;
|
|
|
|
|
|
co_await 5ms;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void resumable_main_mutex()
|
|
|
void resumable_main_mutex()
|
|
|
{
|
|
|
{
|
|
|
std::cout << "begin resumable_mutex_synch()" << std::endl;
|
|
|
|
|
|
resumable_mutex_synch();
|
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
|
//std::cout << "begin resumable_mutex_synch()" << std::endl;
|
|
|
|
|
|
//resumable_mutex_synch();
|
|
|
|
|
|
//std::cout << std::endl;
|
|
|
|
|
|
|
|
|
std::cout << "begin resumable_mutex_async()" << std::endl;
|
|
|
|
|
|
resumable_mutex_async();
|
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
|
|
|
|
//std::cout << "begin resumable_mutex_async()" << std::endl;
|
|
|
|
|
|
//resumable_mutex_async();
|
|
|
|
|
|
//std::cout << std::endl;
|
|
|
|
|
|
|
|
|
std::cout << "begin resumable_mutex_lock_range()" << std::endl;
|
|
|
std::cout << "begin resumable_mutex_lock_range()" << std::endl;
|
|
|
resumable_mutex_lock_range();
|
|
|
resumable_mutex_lock_range();
|