39 if( self->request_waiting_first != NULL )
41 polar_runtime_object_preallocated_init( &iter_waiting_requests, POLAR_TYPE_LIST_NODE_ITERATOR, YES );
42 polar_list_node_iterator_set_target( &iter_waiting_requests, (
polar_list_node *)(self->request_waiting_first) );
44 while( polar_iterator_get_next((
polar_iterator *)(&iter_waiting_requests), (
void **)(&request_current)) )
47 request_sender = request_current->sender_message;
48 request_current->sender_message = request_current->recipient_message;
49 request_current->recipient_message = NULL;
51 polar_thread_message_send(request_current, request_sender);
54 polar_runtime_object_preallocated_finalize( &iter_waiting_requests );
56 self->request_waiting_first = NULL;
57 self->request_waiting_last = NULL;
61 return POLAR_RUNTIME_OBJECT_CLASS(superclass_polar_sync_table_node)->finalize( (
polar_runtime_object *)self );
64POLAR_FUNCTION_INTERNAL
void
68 superclass_polar_sync_table_node = POLAR_RUNTIME_OBJECT_CLASS(self)->class_superclass;
72 (polar_func_runtime_object_lifecycle)_polar_sync_table_node_finalize;
77 .name_type =
"polar_sync_table_node",
80 .type_class_init = (polar_func_runtime_object_class_lifecycle)_polar_sync_table_node_class_init
85POLAR_FUNCTION_INTERNAL OBJC_FUNCTION_CONSTANT polar_internal_type
86polar_sync_table_node_get_type(
void )
88 static polar_internal_type pt_polar_sync_table_node = POLAR_INTERNAL_TYPE_INVALID;
90 if( pt_polar_sync_table_node != POLAR_INTERNAL_TYPE_INVALID )
91 return pt_polar_sync_table_node;
93 pt_polar_sync_table_node = polar_internal_type_init( POLAR_TYPE_HASH_TABLE_NODE_POINTER_KEY,
94 &class_polar_sync_table_node,
95 &pti_polar_sync_table_node );
97 return pt_polar_sync_table_node;
100POLAR_FUNCTION_INTERNAL
void
103 assert( POLAR_IS_SYNC_TABLE_NODE(self) );
104 assert( POLAR_IS_THREAD_MESSAGE(service_request) );
106 if( self->request_waiting_last != NULL )
109 self->request_waiting_last = service_request;
111 if( self->request_waiting_first != NULL )
115 self->request_waiting_first = service_request;
123 assert( POLAR_IS_SYNC_TABLE_NODE(self) );
126 polar_list_node_list_pop_first( (
polar_list_node **)(&self->request_waiting_first) );
128 if( self->request_waiting_first != NULL )
132 self->request_waiting_last = NULL;
Definition polar-internal-type.h:34
Definition polar-iterator.h:25
Definition polar-list-node-iterator.h:25
Definition polar-list-node.h:25
Definition polar-runtime-object.h:36
Definition polar-runtime-object.h:31
Definition polar-sync-table-node.h:33
Definition polar-sync-table-node.h:24
Definition polar-thread-message-queue.h:23
Definition polar-thread-message.h:25