-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessor.h
More file actions
44 lines (35 loc) · 883 Bytes
/
Processor.h
File metadata and controls
44 lines (35 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* File: Processor.h
* Author: Tamaran
*
* Created on 14. Januar 2013, 19:07
*/
#ifndef PROCESSOR_H
#define PROCESSOR_H
#ifdef __cplusplus
extern "C" {
#endif
#include "std.h"
#include "List.h"
#include "Thread.h"
#include "Semaphore.h"
struct __Processor
{
List* list;
void* (*processFkt) (struct __Processor*, void*);
Semaphore mutex;
void* env;
int disposed;
struct __Processor* next;
};
typedef struct __Processor Processor;
Processor* Processor_create(void* env, void* (*processFkt) (Processor*, void*));
void Processor_add(Processor* pro, void* e);
void Processor_loop(Processor* pro);
void Processor_addThread(Processor* pro);
void Processor_join(Processor* pro);
void Processor_dispose(Processor* pro);
#ifdef __cplusplus
}
#endif
#endif /* PROCESSOR_H */