. Threading question Create a typedef data struct called student that has the following members: Char[15] first name . •
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
. Threading question Create a typedef data struct called student that has the following members: Char[15] first name . •
question Create a typedef data struct called student that has the following members: Char[15] first name . • Char[15] last name double money owed Created two student structs with the following initial values: first_name = Tommy, last_name = Douglas, money_owed = 0; first_name = Willie, last_name = O'Ree, money owed = 0; Create two routines called credit tuition and debit tuition that take the student struct and debit or credit 3000.00 to the money owed variable. Add a mutex lock around the code in both routines to prevent access to the student struct. • Write code to debit and credit both students 3000.00 and output the money owed by each student after transactions with their names student probleMLC > ... 1 #include <pthread.h> 2 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> 3 4 5 9 10 11 12 13 14 15 16 17 18 typedef struct Student { 21 22 23 24 25 26 27 student; void credit tuition(void *opt) ( 19 } 20 void debit_tuition(void *opt) { } int main(int argc, char argv[]) { }
. Threading