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
| #include "usg_common.h"
| #include "usg_typedef.h"
| #include "squeue.h"
|
| struct Item
| {
| int pic;
| int info;
|
| };
|
| // 销毁共享内存和信号
| void destroy() {
| void *shmp;
| SQueue<struct Item> *queue;
| int first = mm_init(sizeof(SQueue<struct Item>), &shmp);
|
| if (first == 1)
| queue = new(shmp) SQueue<struct Item>(20);
| else
| queue = (SQueue<struct Item> *) shmp;
|
| queue->~SQueue();
| mm_deinit();
|
|
| }
|
|