Skip to content

Instantly share code, notes, and snippets.

@adurpas
Created December 3, 2012 14:41
Show Gist options
  • Save adurpas/4195417 to your computer and use it in GitHub Desktop.
Save adurpas/4195417 to your computer and use it in GitHub Desktop.
// ISU laboratory session #8, exercise #3.
#ifndef EXITGATE_HPP
#define EXITGATE_HPP
#include <osapi/Thread.hpp>
#include <osapi/Message.hpp>
#include <osapi/MsgQueue.hpp>
#include <osapi/Utility.hpp>
#include "car.hpp"
struct exitGuardOpenReq : public osapi::Message
{
osapi::MsgQueue* mq_;
};
class exitGuard : public osapi::ThreadFunctor
{
public:
enum
{
ID_EXIT_OPEN_REQ,
ID_CAR_EXITED_IND
};
exitGuard(unsigned long queueMaxSize);
osapi::MsgQueue* getMsgQueue();
void handler(unsigned long id, osapi::Message* msg);
~exitGuard();
protected:
virtual void run();
private:
osapi::MsgQueue exitQueue_;
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment