/******************************************************************************/ /** @file "Pthreads/C/Ispitni zadaci/mps_sep_2008_z7.c" @brief Prebrojavanje novca po dzakovima. @author Marko Mišić */ /******************************************************************************/ //MUPS - Septembar 2008 - zadatak 7 //prebrojavanje novca po dzakovima #include #include #include //promenljive u kojima su smesteni podaci o dzakovima int** bags; //niz "duzina" dzakova int* bagsCount; //pojedinacne sume za svaki dzak int* bagsSum; //brava i deljena promenljiva pthread_mutex_t moneyMutex; int moneySum; void* countTheMoney (void* tId) { int i; int myBag = (int)tId; bagsSum[myBag] = 0; for(i=0;i