voie.cpp
来自「开发于Linux下的多线程实例,于Kdevelop下用c++开发,模拟十字路口的」· C++ 代码 · 共 56 行
CPP
56 行
/************************************************************************* Voie.cpp - description ------------------- d閎ut : mer mar 3 2004 copyright : (C) 2004 par Xin ZHOU & Robin WETZEL e-mail : rwetzel@mail.insa-lyon.fr*************************************************************************///---------- R閍lisation de la t鈉he <Voie> (fichier Voie.cpp) -------------////////////////////////////////////////////////////////////////// INCLUDE//-------------------------------------------------------- Include syst鑝e#include <signal.h>#include <stdlib.h>#include <unistd.h>#include <sys/wait.h>#include <sys/msg.h>#include <sys/shm.h>#include <sys/sem.h>//------------------------------------------------------ Include personnel#include "Voie.h"#include "/public/tp/tp-multitache/Voiture.h"#include "/public/tp/tp-multitache/Outils.h"//////////////////////////////////////////////////////////////////// PRIVE//------------------------------------------------------------- Constantes//------------------------------------------------------------------ Typestypedef struct{ bool voie1_3Libre; bool voie2_4Libre;}FormatEtatFeux;//------------------------------------------------------ Variables priv閑s// Identifiant de la file de messages (file de Vehicules)static int idFile;// Handlersstatic struct sigaction destrHnd;static struct sigaction detectionHnd;// Pointeur sur la ZMP etatFeuxstatic FormatEtatFeux * zoneFeux;//------------------------------------------------------ Fonctions priv閑sstatic void HandlerDestruction ( int noSignal )// Mode d'emploi :// Handler associ
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?