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
| #include "usg_common.h"
| #include "usg_typedef.h"
| #include "lock_free_queue.h"
| #include "queue_factory.h"
| #include <pthread.h>
|
| #define NTHREADS 3
|
| struct Item
| {
| int pic;
| int info;
|
| };
|
| struct Targ {
| int key;
| int start;
| int end;
| };
|
| // 销毁共享内存和信号
| void destroy(int key) {
|
| // LockFreeQueue<struct Item> *queue = QueueFactory::createQueue<struct Item> (1, 16);
| // //queue->~LockFreeQueue();
| // delete queue;
|
| QueueFactory::dropQueue<struct Item>(key);
| mm_destroy();
|
|
| }
|
|