VLC  3.0.0-git
Typedefs | Functions
Interrupt context signaling and manipulation
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. More...
 
void vlc_interrupt_destroy (vlc_interrupt_t *)
 Destroys an interrupt context. More...
 
vlc_interrupt_tvlc_interrupt_set (vlc_interrupt_t *)
 Sets the interruption context for the calling thread. More...
 
void vlc_interrupt_raise (vlc_interrupt_t *)
 Raises an interruption through a specified context. More...
 
void vlc_interrupt_kill (vlc_interrupt_t *)
 Marks the interruption context as "killed". More...
 
bool vlc_killed (void)
 Checks if the interruption context was "killed". More...
 
void vlc_interrupt_forward_start (vlc_interrupt_t *to, void *data[2])
 Enables forwarding of interruption. More...
 
int vlc_interrupt_forward_stop (void *const data[2])
 Undoes vlc_interrupt_forward_start(). More...
 

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().

◆ vlc_interrupt_destroy()

void vlc_interrupt_destroy ( vlc_interrupt_t )

Destroys an interrupt context.

References vlc_interrupt_deinit().

◆ 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

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::callback, vlc_interrupt::data, vlc_interrupt_finish(), and vlc_interrupt_forward_wake().

◆ vlc_interrupt_kill()

void vlc_interrupt_kill ( vlc_interrupt_t )

Marks the interruption context as "killed".

This is not reversible.

References atomic_store, vlc_interrupt::killed, and vlc_interrupt_raise().

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

◆ vlc_interrupt_raise()

void vlc_interrupt_raise ( vlc_interrupt_t )

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 )

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 FetcherThread(), Preparse(), and Run().

◆ 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 atomic_load, vlc_interrupt::killed, and vlc_interrupt_var.

Referenced by AStreamReadBlock(), AStreamReadStream(), Downloader(), net_Connect(), net_Read(), net_Write(), vlc_stream_ReadBlock(), vlc_stream_ReadRaw(), vlc_tls_Read(), vlc_tls_WaitConnect(), and vlc_tls_Write().