critical_section.h File Reference
#include "pico/lock_core.h"
Include dependency graph for critical_section.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  critical_section
 

Typedefs

typedef struct __packed_aligned critical_section critical_section_t
 

Functions

void critical_section_init (critical_section_t *crit_sec)
 Initialise a critical_section structure allowing the system to assign a spin lock numberThe critical section is initialized ready for use, and will use a (possibly shared) spin lock number assigned by the system. Note that in general it is unlikely that you would be nesting critical sections, however if you do so you must use critical_section_init_with_lock_num to ensure that the spin lock's used are different. More...
 
void critical_section_init_with_lock_num (critical_section_t *crit_sec, uint lock_num)
 Initialise a critical_section structure assigning a specific spin lock number. More...
 
static void critical_section_enter_blocking (critical_section_t *crit_sec)
 Enter a critical_sectionIf the spin lock associated with this critical section is in use, then this method will block until it is released. More...
 
static void critical_section_exit (critical_section_t *crit_sec)
 Release a critical_section. More...
 
void critical_section_deinit (critical_section_t *crit_sec)
 De-Initialise a critical_section created by the critical_section_init methodThis method is only used to free the associated spin lock allocated via the critical_section_init method (it should not be used to de-initialize a spin lock created via critical_section_init_with_lock_num). After this call, the critical section is invalid. More...
 
static bool critical_section_is_initialized (critical_section_t *crit_sec)
 Test whether a critical_section has been initialized. More...