osReleaseSharedMemory function
Declaration:
BOOL osReleaseSharedMemory(
  HANDLE Handle
);
Parameters:
Handle

The handle to the shared memory object to be released.

Return value:

Returns TRUE on success or FALSE on failure. To retrieve extended error information, call the osGetLastError function.

Description:

This function releases ownership of a shared memory object, allowing other tasks to access the protected memory region.

When a task completes its operations within the shared memory buffer, it must invoke osReleaseSharedMemory to relinquish control. If other tasks are currently blocked while waiting for this specific object, the system will grant ownership to the highest-priority waiting task, transitioning it to the ready state.

The behavior of ownership release depends on the synchronization mode selected during object creation:

  • If mutex synchronization is used, the system ensures that only the current owner can release the object and handles priority inheritance adjustments. For more details, refer to the Mutex Objects section.
  • If event synchronization is used, the object transitions to the signaled state to wake a waiting task.

For additional information regarding shared memory management and best practices, please refer to the Shared Memory section.

This function is available only when the OS_USE_SHARED_MEM configuration constant is set to 1.

Version:1.0
Header file:OS_SharedMem.h (include OS_API.h)
See also: BOOL, FALSE, HANDLE, osCreateSharedMemory, osGetLastError, shared memory, TRUE
SpaceShadow documentation