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
| #include "usg_common.h"
| #include "usg_typedef.h"
| #include "SArrayLockFreeQueue.h"
| #include "SLinkedLockFreeQueue.h"
| #include "QFactory.h"
| #include <pthread.h>
|
| #define NTHREADS 3
|
| struct Item
| {
| int pic;
| int info;
|
| };
|
| struct Targ {
| int key;
| int start;
| int end;
| };
|
| // 销毁共享内存和信号
| void destroy() {
|
| SLinkedLockFreeQueue<struct Item> *queue = QFactory::createLinkedLockFreeQueue<struct Item> (1, 10);
| queue->~SLinkedLockFreeQueue();
| mm_deinit();
|
|
| }
|
|