FastSemaphore Sample
Description
This sample is designed to demonstrate the usage and abilities of the FastSemaphore functions. It contains the following features:
- Uses a FastSemaphore as a binary semaphore, acquiring and releasing the FastSemaphore from different threads.
- Uses the main thread to control FastSemaphore access to run one child thread at a time.
- Uses the main thread to control FastSemaphore access to run all children threads.
Source Files
| File | Description |
|---|---|
| FastSemaphore.c | |
| FastSemaphore.h |
Building the Sample
- Open a project file in the corresponding Visual Studio version you are using for development.
- Build the project.
Running the Sample
To run the sample:
- Boot the system in its Windows Boot Configuration.
- Navigate to
<InstallDrive>\MaxRT\eRTOS\. - Right-click AutoStart.bat and select Edit.
- Find or write the Run command(s) for FastSemaphore.
Note: For more information on Run commands, see Run.
- If using pre-written Run command(s), remove the comment characters (: :) to enable the command(s).
- Re-boot the system from a GRUB bootable USB drive or hard drive.
- Select the desired GRUB boot configuration. See GRUB Boot Configurations for more information.
- Upon system boot, the sample(s) will run automatically after the eRTOS Kernel startup.
- Sample output will be displayed on the screen when the program ends.
- Re-boot the system in its Windows Boot Configuration.
- Navigate to
<InstallDrive>\MaxRT\eRTOS\. - Open the RtLogFile.txt log file to view sample output.
Remarks
This sample supports the following configurations:
- eRTOSDebug(x64)
- eRTOSRelease(x64)
This sample requires at least two processors assigned to and configured for eRTOS.
APIs Referenced