Universal Cooperative Multithread Lib with real time Scheduler that was designed to work, virtually, into any modern micro controller or Microchip and, also, for user space applications for modern OS (Mac, Linux, Windows) or on FreeRTOS as well. Supports C and C++
Default messages on platform with DEBUG and printf on.
Implement TRACE for auto-disabling on non compatible platforms
Be aware: CorePartition_SetStackOverflowHandler will be retired since Cpx_StackOverflowHandler will be always available as weak function to be overflown by C or C++
The idea is to provide CreateStaticThread that instead of providing the size of a stack, the programmer can provide a array that will be used as stack.
Minimal impact to CoreThread structure
Add a 8 bits data to signify stack type, this will control when StopThread should release the memory.
This lock works like a semaphore, the programmer will lock using wait() and will be unlocked (one only or all) on notify
VariableLockWait function
VariableLockNotifyOne function
VariableLockNotifyAll function
The lock controller will be any variable pointer casted to (void*), the size_t value will be used in the context controller as the variable lock label, making any variable a lock.
Additionally, on notify, the programmer can propagate a size_t value to all way locks, giving meaning to the notification and, also, turning it into a IPC
The process will be controlled by the scheduler, so a new thread status must be created and the scheduler must comply with it.