kupl_queue_wait_all
Synchronize all queues created by calling the kupl_queue_acquire interface.
Interface Definition
int kupl_queue_wait_all();
Parameters
None
Return Value
Success: KUPL_OK
Failure: KUPL_ERROR
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include <stdio.h> #include "kupl.h" static inline void kernel_func(void *args) { printf("kernel exec.\n"); } int main() { kupl_queue_h q1 = kupl_queue_acquire(1); kupl_queue_h q2 = kupl_queue_acquire(2); kupl_queue_item_desc_t desc = { .field_mask = KUPL_QUEUE_ITEM_DESC_FIELD_NAME, .func = kernel_func, .args = NULL, .name = "kernel_name" }; kupl_queue_submit(q1, &desc); kupl_queue_submit(q2, &desc); kupl_queue_wait_all(); return 0; } |
The preceding example demonstrates how to obtain the handles of queues numbered 1 and 2, submit an item to each queue, and then use kupl_queue_wait_all for synchronization.
Parent topic: Multi-queue Multi-stream Programming Functions