#include "pandabase.h"#include "thread.h"#include "conditionVar.h"#include "mutexHolder.h"#include "pointerTo.h"Go to the source code of this file.
| Compounds | |
| class | philosopher | 
| Defines | |
| #define | PRINTMSG(x) { MutexHolder l(print_mutex); x; } | 
| #define | N_DINERS 5 | 
| Functions | |
| double | random_f (double max) | 
| PT (philosopher) phils[N_DINERS] | |
| int | main (int, char **) | 
| Variables | |
| Mutex | rand_mutex | 
| Mutex | print_mutex | 
| Mutex | chopsticks [N_DINERS] | 
| Mutex | room_mutex | 
| ConditionVar | room_condition (room_mutex) | 
| int | room_occupancy = 0 | 
| 
 | 
| 
 Definition at line 51 of file test_diners.cxx. Referenced by main(), and philosopher::thread_main(). | 
| 
 | 
| 
 Definition at line 47 of file test_diners.cxx. Referenced by main(), and philosopher::thread_main(). | 
| 
 | ||||||||||||
| 
 Definition at line 116 of file test_diners.cxx. References Mutex::lock(), N_DINERS, Thread::prepare_for_exit(), PRINTMSG, Mutex::release(), room_condition, room_mutex, room_occupancy, Thread::sleep(), TP_normal, and ConditionVar::wait(). | 
| 
 | 
| 
 | 
| 
 | 
| 
 Definition at line 35 of file test_diners.cxx. References rand_mutex. Referenced by philosopher::thread_main(). | 
| 
 | 
| 
 Definition at line 53 of file test_diners.cxx. Referenced by philosopher::thread_main(). | 
| 
 | 
| 
 Definition at line 45 of file test_diners.cxx. | 
| 
 | 
| 
 Definition at line 33 of file test_diners.cxx. Referenced by random_f(), and philosopher::thread_main(). | 
| 
 | 
| 
 Referenced by main(), and philosopher::thread_main(). | 
| 
 | 
| 
 Definition at line 59 of file test_diners.cxx. Referenced by main(), and philosopher::thread_main(). | 
| 
 | 
| 
 Definition at line 62 of file test_diners.cxx. Referenced by main(), and philosopher::thread_main(). | 
 1.3
1.3