iPXE
Data Structures | Functions | Variables
pending.h File Reference

Pending operations. More...

Go to the source code of this file.

Data Structures

struct  pending_operation
 A pending operation. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static int is_pending (struct pending_operation *pending)
 Check if an operation is pending.
static int have_pending (void)
 Check if any operations are pending.
void pending_get (struct pending_operation *pending)
 Mark an operation as pending.
void pending_put (struct pending_operation *pending)
 Mark an operation as no longer pending.

Variables

int pending_total
 Total count of pending operations.

Detailed Description

Pending operations.

Definition in file pending.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static int is_pending ( struct pending_operation pending) [inline, static]

Check if an operation is pending.

Parameters:
pendingPending operation
Return values:
is_pendingOperation is pending

Definition at line 24 of file pending.h.

References pending_operation::count.

Referenced by tcp_close(), tls_ready(), and tls_restart().

                                                                   {
        return ( pending->count != 0 );
}
static int have_pending ( void  ) [inline, static]

Check if any operations are pending.

Return values:
have_pendingSome operations are pending

Definition at line 35 of file pending.h.

References pending_total.

Referenced by sync_progress().

                                        {
        return ( pending_total != 0 );
}
void pending_get ( struct pending_operation pending)

Mark an operation as pending.

Parameters:
pendingPending operation

Definition at line 45 of file pending.c.

References pending_operation::count, DBGC, and pending_total.

Referenced by tcp_close(), tcp_open(), tcp_rx_ack(), tcp_xfer_deliver(), and tls_restart().

                                                       {

        pending->count++;
        pending_total++;
        DBGC ( pending, "PENDING %p incremented to %d (total %d)\n",
               pending, pending->count, pending_total );
}
void pending_put ( struct pending_operation pending)

Mark an operation as no longer pending.

Parameters:
pendingPending operation

Definition at line 58 of file pending.c.

References pending_operation::count, DBGC, and pending_total.

Referenced by tcp_close(), tcp_process_tx_queue(), tcp_rx_ack(), tls_close(), tls_new_finished(), and tls_send_finished().

                                                       {

        if ( pending->count ) {
                pending_total--;
                pending->count--;
                DBGC ( pending, "PENDING %p decremented to %d (total %d)\n",
                       pending, pending->count, pending_total );
        }
}

Variable Documentation

Total count of pending operations.

Definition at line 38 of file pending.c.

Referenced by have_pending(), pending_get(), and pending_put().