コード例 #1
0
ファイル: Bienstein.c プロジェクト: yonatana/OS
// This function will be called by the cup boy when he wishes to get a dirty cup to clean. 
Cup* wash_dirty(){
  return BB_pop(DBB);
}
コード例 #2
0
ファイル: Bienstein.c プロジェクト: yonatana/OS
// This function is called by a student after he places an order for a drink, 
// while he waits for his order to be made. 
// If there is a drink ready in the buffer, he will take it (denoted by the cup the drink was made in). 
// If not, he will wait until a drink becomes available
Cup* get_drink(){
  return BB_pop(DrinkBB);
}
コード例 #3
0
ファイル: Bienstein.c プロジェクト: yonatana/OS
// This function is called by a bartender whenever he wishes to make a drink and needs a clean cup for it. 
// If there are no clean cups left, the bartender should wait until the cup boy returns with clean cups.
Cup* get_clean_cup(){
  return BB_pop(CBB);
}
コード例 #4
0
ファイル: Bienstein.c プロジェクト: yonatana/OS
// This function is called by a bartender whenever one is free to deal with students’ actions. 
// The Action located at the beginning of the buffer is returned and removed. 
// If there are no actions, the bartender will wait until more actions arrive.
Action* get_action(){
  return BB_pop(ABB);
}
コード例 #5
0
ファイル: simulation.c プロジェクト: RonBarabash/OS132-Ass2
struct Cup* get_drink()
{
	struct Cup* c=(struct Cup*) BB_pop(drinkBB);
	return c;
}
コード例 #6
0
ファイル: simulation.c プロジェクト: RonBarabash/OS132-Ass2
struct Action* get_action(void)
{
	struct Action* ac=(struct Action*) BB_pop(bb);
	printf(1, "\ngot action\n");
	return ac;
}
コード例 #7
0
ファイル: simulation.c プロジェクト: RonBarabash/OS132-Ass2
struct Cup* wash_dirty()
{
	struct Cup* c=(struct Cup*) BB_pop(dbb);
	dc_count--;
	return c;
}
コード例 #8
0
ファイル: simulation.c プロジェクト: RonBarabash/OS132-Ass2
struct Cup* get_clean_cup()
{
	struct Cup* c=(struct Cup*) BB_pop(cbb);
	return c;
}