Commit Graph

5 Commits

Author SHA1 Message Date
Sandy Carter 634f87f63b [threading linux] Implement Callback Queuing
Add thread local bool for alertable state.
Use real-time event interrupt to run callback.
Fix sleep duration from miliseconds (microseconds / 1000) to seconds in sleep
command.
Add note for future implementation.

Ignore real-time event 37 in .gdbinit which is used to signal callback.

Test AlertableSleep
Test Thread QueueUserCallback.
TODO: Test alerted wait result when using IO functions.
2020-11-15 11:12:05 -06:00
Sandy Carter 4397f25325 [threading linux] Implement suspendable pthreads
Use real-time event interrupt to communicate suspend in timely manner.
Use conditional_variable to implement suspend wait and resume trigger.

Ignore real-time event 36 in .gdbinit which is used to signal suspend.

Test suspending threads.
2020-11-15 11:12:05 -06:00
Sandy Carter b91203a0b5 [threading linux] Implement basic Thread function
Add Basic Tests on Threads
2020-11-15 11:12:05 -06:00
Sandy Carter c2de074d5c [threading linux] Implement Timer
Test Manual Reset and Synchronization timers single threaded.
Test Cancelling timers.
Test WaitMultiple.
Ignore real-time event 35 in .gdbinit which is used to signal timer.

Callbacks don't seem to be called so testing them is difficult.
2020-11-15 11:12:05 -06:00
Sandy Carter b5ea686475 [threading] Implement Posix HighResolutionTimer
Implement HighResolutionTimer for Posix by using native timers.
Callbacks are triggered with realtime interrupts if they are supported.
Create an enum to track user-defined interrupts as well as an initializer and
handler to register these interrupts per thread.
Add test cases for timers for both single and multiple.
Fix Sleep function to continue sleeping if interrupted by system.
Add local .gdbinit to ignore signal 34 which is used by high res timer
2020-11-15 11:12:05 -06:00