start plugins transformation, SUV theme
[cinelerra_cv/ct.git] / guicast / sema.h
blobefee52d835e4b4efb75957103d0c96ddc9bbdd66
1 #ifndef SEMA_H
2 #define SEMA_H
5 #include <semaphore.h>
7 class Sema
9 public:
10 Sema(int init_value = 1, char *title = 0);
11 ~Sema();
13 void lock(char *location = 0);
14 void unlock();
15 int get_value();
16 void reset();
18 sem_t sem;
19 char *title;
20 int init_value;
30 #if 0
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <sys/ipc.h>
36 #include <sys/sem.h>
37 #include <sys/types.h>
39 union semun {
40 int val; /* used for SETVAL only */
41 struct semid_ds *buf; /* for IPC_STAT and IPC_SET */
42 ushort *array; /* used for GETALL and SETALL */
45 class Sema
47 public:
48 Sema(int id = -1, int number = 1);
49 ~Sema();
51 int lock(int number = 0);
52 int unlock(int number = 0);
53 int get_value(int number = 0);
54 int get_id();
56 int semid;
57 int client;
58 int semas;
59 semun arg;
62 #endif
68 #endif
70 // Local Variables:
71 // mode: C++
72 // c-file-style: "linux"
73 // End: