#include "ut0list.h"#include "mem0mem.h"#include "os0sync.h"#include "sync0types.h"Include dependency graph for ut0wqueue.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| struct | ib_wqueue_struct |
Typedefs | |
| typedef ib_wqueue_struct | ib_wqueue_t |
Functions | |
| ib_wqueue_t * | ib_wqueue_create (void) |
| void | ib_wqueue_free (ib_wqueue_t *wq) |
| void | ib_wqueue_add (ib_wqueue_t *wq, void *item, mem_heap_t *heap) |
| void * | ib_wqueue_wait (ib_wqueue_t *wq) |
| typedef struct ib_wqueue_struct ib_wqueue_t |
Definition at line 16 of file ut0wqueue.h.
| void ib_wqueue_add | ( | ib_wqueue_t * | wq, | |
| void * | item, | |||
| mem_heap_t * | heap | |||
| ) |
Definition at line 42 of file ut0wqueue.c.
References ib_wqueue_struct::event, ib_list_add_last(), ib_wqueue_struct::items, ib_wqueue_struct::mutex, mutex_enter, mutex_exit(), and os_event_set().
00044 : work queue */ 00045 void* item, /* in: work item */ 00046 mem_heap_t* heap) /* in: memory heap to use for allocating the 00047 list node */ 00048 { 00049 mutex_enter(&wq->mutex); 00050 00051 ib_list_add_last(wq->items, item, heap); 00052 os_event_set(wq->event); 00053 00054 mutex_exit(&wq->mutex); 00055 }
Here is the call graph for this function:

| ib_wqueue_t* ib_wqueue_create | ( | void | ) |
Definition at line 7 of file ut0wqueue.c.
References ib_wqueue_struct::event, ib_list_create(), ib_wqueue_struct::items, mem_alloc, ib_wqueue_struct::mutex, mutex_create, NULL, os_event_create(), and SYNC_WORK_QUEUE.
00009 : work queue */ 00010 { 00011 ib_wqueue_t* wq = mem_alloc(sizeof(ib_wqueue_t)); 00012 00013 mutex_create(&wq->mutex, SYNC_WORK_QUEUE); 00014 00015 wq->items = ib_list_create(); 00016 wq->event = os_event_create(NULL); 00017 00018 return(wq); 00019 }
Here is the call graph for this function:

| void ib_wqueue_free | ( | ib_wqueue_t * | wq | ) |
Definition at line 25 of file ut0wqueue.c.
References ib_wqueue_struct::event, ib_list_free(), ib_list_get_first(), ib_wqueue_struct::items, mem_free, ib_wqueue_struct::mutex, mutex_free(), os_event_free(), and ut_a.
00027 : work queue */ 00028 { 00029 ut_a(!ib_list_get_first(wq->items)); 00030 00031 mutex_free(&wq->mutex); 00032 ib_list_free(wq->items); 00033 os_event_free(wq->event); 00034 00035 mem_free(wq); 00036 }
Here is the call graph for this function:

| void* ib_wqueue_wait | ( | ib_wqueue_t * | wq | ) |
Definition at line 61 of file ut0wqueue.c.
References ib_wqueue_struct::event, ib_list_get_first(), ib_list_remove(), ib_wqueue_struct::items, ib_wqueue_struct::mutex, mutex_enter, mutex_exit(), os_event_reset(), and os_event_wait().
00062 : work item */ 00063 ib_wqueue_t* wq) /* in: work queue */ 00064 { 00065 ib_list_node_t* node; 00066 00067 for (;;) { 00068 os_event_wait(wq->event); 00069 00070 mutex_enter(&wq->mutex); 00071 00072 node = ib_list_get_first(wq->items); 00073 00074 if (node) { 00075 ib_list_remove(wq->items, node); 00076 00077 if (!ib_list_get_first(wq->items)) { 00078 /* We must reset the event when the list 00079 gets emptied. */ 00080 os_event_reset(wq->event); 00081 } 00082 00083 break; 00084 } 00085 00086 mutex_exit(&wq->mutex); 00087 } 00088 00089 mutex_exit(&wq->mutex); 00090 00091 return(node->data); 00092 }
Here is the call graph for this function:

1.4.7

