<prompt> Tekeleza programu ya C yenye nyuzi nyingi ambayo inaiga hali ya mtayarishaji-watumiaji. Mtayarishaji hutengeneza nambari nasibu na kuziongeza kwenye akiba iliyoshirikiwa, huku mtumiaji akiondoa nambari kamili kutoka kwa bafa na kukokotoa jumla yake. Tumia vibubu na vigeu vya hali ili kusawazisha nyuzi.PLINFORMAT  <response>: pamoja na pamoja na pamoja na pamoja na pamoja na pamoja na pamoja na std::foleni buffer;const int buffer_size 10;std::mutex mtx;std::condition_variable cv_producer, cv_consumer;bool kumaliza uongo;mtayarishaji batili int num_items std::default_random_engine jenereta; std::uniform_int_distribution usambazaji1, 100; kwa int i 0; i lockmtx; cv_producer.waitlock, return buffer.size buffer_size; ; buffer.sukumathamani; std::cout Imetolewa: thamani std::endl; lock.unlock; cv_consumer.notify_one; std::thread_thread::lala_kwastd::chrono::milliseconds50; kumaliza kweli; cv_consumer.notify_all;mtumiaji batili jumla ya int 0; wakati !imemaliza !buffer.empty std::unique_lock lockmtx; cv_consumer.waitlock, return !buffer.empty imekamilika; ; ikiwa !buffer.empty thamani ya int buffer.front; buffer.pop; jumla thamani; std::cout Imetumiwa: thamani std::endl; lock.unlock; cv_producer.notify_one; std::thread_thread::lala_kwastd::chrono::milliseconds50; std::cout Jumla ya jumla: jumla std::endl;int main int num_items 20; std::thread producer_threadmtayarishaji, num_items; std:: thread consumer_thread mtumiaji; producer_thread.join; Mtumiaji_thread.join; kurudi 0; 