Skip to content

Instantly share code, notes, and snippets.

@adurpas
Created December 3, 2012 14:42
Show Gist options
  • Save adurpas/4195427 to your computer and use it in GitHub Desktop.
Save adurpas/4195427 to your computer and use it in GitHub Desktop.
// ISU laboratory session #8, exercise #3.
#ifndef CAR_HPP
#define CAR_HPP
#include <osapi/Thread.hpp>
#include <osapi/Message.hpp>
#include <osapi/MsgQueue.hpp>
#include <osapi/Utility.hpp>
#include "EntryGuard.hpp"
#include "ExitGuard.hpp"
class car : public osapi::ThreadFunctor
{
public:
enum
{
ID_CAR_START_IND,
ID_ENTRY_OPEN_CFM,
ID_EXIT_OPEN_CFM,
};
car(int carThreadID, unsigned long queueMaxSize, entryGuard* entryGuard, exitGuard* exitGuard);
osapi::MsgQueue* getMsgQueue();
void handler(unsigned long id, osapi::Message* msg);
~car();
protected:
virtual void run();
private:
int carID_;
osapi::MsgQueue carQueue_;
entryGuard* entryGuard_;
exitGuard* exitGuard_;
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment