VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Interrupt context signaling and manipulation:

Typedefs

typedef struct vlc_interrupt vlc_interrupt_t
 

Functions

vlc_interrupt_tvlc_interrupt_create (void)
 Creates an interruption context.
 
void vlc_interrupt_destroy (vlc_interrupt_t *)
 Destroys an interrupt context.
 
vlc_interrupt_tvlc_interrupt_set (vlc_interrupt_t *)
 Sets the interruption context for the calling thread.
 
void vlc_interrupt_raise (vlc_interrupt_t *)
 Raises an interruption through a specified context.
 
void vlc_interrupt_kill (vlc_interrupt_t *)
 Marks the interruption context as "killed".
 
bool vlc_killed (void)
 Checks if the interruption context was "killed".
 
void vlc_interrupt_forward_start (vlc_interrupt_t *to, void *data[2])
 Enables forwarding of interruption.
 
int vlc_interrupt_forward_stop (void *const data[2])
 Undoes vlc_interrupt_forward_start().
 

Detailed Description

Typedef Documentation

◆ vlc_interrupt_t

Function Documentation

◆ vlc_interrupt_create()

vlc_interrupt_t * vlc_interrupt_create ( void  )

Creates an interruption context.

References likely, and vlc_interrupt_init().

Referenced by addons_manager_New().

◆ vlc_interrupt_destroy()

void vlc_interrupt_destroy ( vlc_interrupt_t ctx)

Destroys an interrupt context.

References vlc_interrupt_deinit().

Referenced by addons_manager_New().

◆ vlc_interrupt_forward_start()

void vlc_interrupt_forward_start ( vlc_interrupt_t to,
void *  data[2] 
)

Enables forwarding of interruption.

If an interruption is raised through the context of the calling thread, it will be forwarded to the specified other context. This is used to cross thread boundaries.

If the calling thread has no interrupt context, this function does nothing.

Parameters
tocontext to forward to
dataopaque data pointer for the callback

References vlc_interrupt_forward_wake(), vlc_interrupt_prepare(), and vlc_interrupt_var.

◆ vlc_interrupt_forward_stop()

int vlc_interrupt_forward_stop ( void *const  data[2])

Undoes vlc_interrupt_forward_start().

This function must be called after each successful call to vlc_interrupt_forward_start() before any other interruptible call is made in the same thread.

If an interruption was raised against the context of the calling thread (after the previous call to vlc_interrupt_forward_start()), it is dequeued.

If the calling thread has no interrupt context, this function does nothing and returns zero.

Returns
0 if no interrupt was raised, EINTR if an interrupt was raised

References vlc_interrupt_finish(), and vlc_interrupt_forward_wake().

◆ vlc_interrupt_kill()

void vlc_interrupt_kill ( vlc_interrupt_t ctx)

Marks the interruption context as "killed".

This is not reversible.

References vlc_interrupt::killed, and vlc_interrupt_raise().

Referenced by addons_manager_Delete(), input_Stop(), and vlc_interrupt_forward_wake().

◆ vlc_interrupt_raise()

void vlc_interrupt_raise ( vlc_interrupt_t ctx)

Raises an interruption through a specified context.

This is used to asynchronously wake a thread up while it is waiting on some other events (typically I/O events).

Note
This function is thread-safe.
This function is not a cancellation point.

References vlc_interrupt::callback, vlc_interrupt::data, vlc_interrupt::interrupted, vlc_interrupt::lock, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by vlc_interrupt_forward_wake(), and vlc_interrupt_kill().

◆ vlc_interrupt_set()

vlc_interrupt_t * vlc_interrupt_set ( vlc_interrupt_t newctx)

Sets the interruption context for the calling thread.

Parameters
newctxthe interruption context to attach or NULL for none
Returns
the previous interruption context or NULL if none
Note
This function is not a cancellation point.
Warning
A context can be attached to no more than one thread at a time.

References vlc_interrupt_var.

Referenced by FinderThread(), InstallerThread(), Preparse(), Run(), RunDownloader(), RunSearchLocal(), and RunSearchNetwork().

◆ vlc_killed()

bool vlc_killed ( void  )

Checks if the interruption context was "killed".

Indicates whether the interruption context of the calling thread (if any) was killed with vlc_interrupt_kill().

References vlc_interrupt::killed, and vlc_interrupt_var.

Referenced by AStreamReadBlock(), AStreamReadStream(), get_dialog_provider(), net_Connect(), net_Read(), net_Write(), RunDownloader(), vlc_credential_get(), vlc_stream_ReadBlock(), vlc_stream_ReadRaw(), vlc_tls_ClientSessionCreate(), vlc_tls_Read(), vlc_tls_WaitConnect(), and vlc_tls_Write().