@@ -206,6 +206,33 @@ set(OSAL_CONFIG_CONSOLE_ASYNC TRUE
206206 CACHE BOOL "Controls spawning of a separate utility task for OS_printf"
207207)
208208
209+ #
210+ # OS_CONFIG_RWLOCK
211+ # ----------------------------------
212+ #
213+ # Controls whether the readers-writer lock object is included in the compilation
214+ # process of the OSAL.
215+ #
216+ # If set FALSE, the relevant source and header files will be excluded in the compilation
217+ # of OSAL, such that the object is still registered with the Object ID system
218+ # but its associated functions won't be defined or declared.
219+ #
220+ # If set TRUE, the relevant source and header files will be included in the compilation
221+ # of OSAL, and all it's associated functions will be callable.
222+ #
223+ # When this is TRUE (default), it gives the ability to create a readers-writer lock as
224+ # an alternative to synchronization with mutexes for data structures that are read-heavy.
225+ # It allows for either an infinite number of readers to be accessing a data structure or
226+ # a single writer.
227+ #
228+ # This option is available since some platforms may not support readers-writer locks, so
229+ # any use of a readers-writer lock should also create an implementation using solely
230+ # mutexes.
231+ #
232+ set (OSAL_CONFIG_RWLOCK TRUE
233+ CACHE BOOL "Controls the inclusion of readers-writer lock objects in the code"
234+ )
235+
209236#############################################
210237# Resource Limits for the OS API
211238#############################################
@@ -238,6 +265,11 @@ set(OSAL_CONFIG_MAX_MUTEXES 20
238265 CACHE STRING "Maximum Number of Mutexes to support"
239266)
240267
268+ # The maximum number of rwlocks to support
269+ set (OSAL_CONFIG_MAX_RWLOCKS 20
270+ CACHE STRING "Maximum Number of RwLocks to support"
271+ )
272+
241273# The maximum number of condition variables to support
242274set (OSAL_CONFIG_MAX_CONDVARS 4
243275 CACHE STRING "Maximum Number of Condition Variables to support"
0 commit comments