Mercurial > hg > Game > Cerium
view TaskManager/kernel/ppe/Sem.h @ 1463:f7e497c8e8a3 draft
TaskList on going...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 14 Jul 2012 20:44:23 +0900 |
parents | 4c209dd223cd |
children | f73ca57cdc81 |
line wrap: on
line source
#ifndef INCLUDED_SEM #define INCLUDED_SEM #include <pthread.h> typedef struct sem_t { volatile int value; //セマフォ変数 pthread_mutex_t mutex; //セマフォ操作用のロック pthread_cond_t cond; //待ち合わせ用の条件変数 } sem_t, *sem_ptr; class Sem { public: /* constructor */ Sem(int value); ~Sem(); void sem_p(); void sem_v(); int count(); /* variables */ private: sem_t *sem; }; typedef Sem *SemPtr; #endif /* INCLUDED_SEM */