win-pvdrivers

view liblfds.6/src/single_dir_for_windows_kernel/queue_delete.c @ 1025:aa2e51f67f7c

Fix hibernate under Win8. Change debugprints.
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 19 15:14:53 2013 +1100 (2013-02-19)
parents 6300617040e0
children
line source
1 #include "queue_internal.h"
7 /****************************************************************************/
8 void queue_delete( struct queue_state *qs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state )
9 {
10 void
11 *user_data;
13 assert( qs != NULL );
14 // TRD : user_data_delete_function can be NULL
15 // TRD : user_state can be NULL
17 while( queue_dequeue(qs, &user_data) )
18 if( user_data_delete_function != NULL )
19 user_data_delete_function( user_data, user_state );
21 /* TRD : fully dequeuing will leave us
22 with a single dummy element
23 which both qs->enqueue and qs->dequeue point at
24 we push this back onto the freelist
25 before we delete the freelist
26 */
28 freelist_push( qs->fs, qs->enqueue[QUEUE_POINTER]->fe );
30 freelist_delete( qs->fs, queue_internal_freelist_delete_function, NULL );
32 abstraction_aligned_free( qs );
34 return;
35 }
41 /****************************************************************************/
42 #pragma warning( disable : 4100 )
44 void queue_internal_freelist_delete_function( void *user_data, void *user_state )
45 {
46 assert( user_data != NULL );
47 assert( user_state == NULL );
49 abstraction_aligned_free( user_data );
51 return;
52 }
54 #pragma warning( default : 4100 )