Changeset 124:cc42d8607114 in freeDiameter for freeDiameter/queues.c
- Timestamp:
- Dec 10, 2009, 2:15:04 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/queues.c
r123 r124 51 51 } 52 52 53 /* Destroy the routing message queues*/54 int fd_queues_fini _rt(void)53 /* Destroy a queue after emptying it (and dumping the content) */ 54 int fd_queues_fini(struct fifo ** queue) 55 55 { 56 TRACE_ENTRY(); 56 struct msg * msg; 57 int ret = 0; 57 58 59 TRACE_ENTRY("%p", queue); 60 61 /* Note : the threads that post into this queue should already been stopped before this !!! */ 62 58 63 /* Empty all contents */ 59 TODO("Empty all contents (dump to log file ?)"); 64 while (1) { 65 /* Check if there is a message in the queue */ 66 ret = fd_fifo_tryget(*queue, &msg); 67 if (ret == EWOULDBLOCK) 68 break; 69 CHECK_FCT(ret); 70 71 /* We got one! */ 72 fd_log_debug("The following message is lost because the daemon is stopping:\n"); 73 fd_msg_dump_walk(NONE, msg); 74 fd_msg_free(msg); 75 } 60 76 61 /* Now, delete the queues */ 62 CHECK_FCT( fd_fifo_del ( &fd_g_incoming ) ); 63 CHECK_FCT( fd_fifo_del ( &fd_g_outgoing ) ); 77 /* Now, delete the empty queue */ 78 CHECK_FCT( fd_fifo_del ( queue ) ); 64 79 65 80 return 0; 66 81 } 67 68 /* Destroy the local message queue */69 int fd_queues_fini_disp(void)70 {71 TRACE_ENTRY();72 73 /* Empty all contents */74 TODO("Empty all contents (dump to log file ?)");75 76 CHECK_FCT( fd_fifo_del ( &fd_g_local ) );77 78 return 0;79 }
Note: See TracChangeset
for help on using the changeset viewer.