aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
AgeCommit message (Collapse)Author
2015-05-07Common: Remove common.hYuri Kunde Schlesner
2015-05-01Kernel: Properly initialize and shutdown all modules.bunnei
2015-04-09Kernel: Implemented priority inheritance for mutexes.bunnei
2015-04-09Thread: Implement priority boost for starved threads.bunnei
SVC: Return correct error code on invalid CreateThread processor ID. SVC: Assert when creating a thread with an invalid userland priority.
2015-02-19Misc cleanup of common and related functionsarchshift
2015-02-10Asserts: break/crash program, fit to style guide; log.h->assert.harchshift
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time) As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing) Also removed some GEKKO cruft.
2015-02-09Scheduler refactor Pt. 1Kevin Hartman
* Simplifies scheduling logic, specifically regarding thread status. It should be much clearer which statuses are valid for a thread at any given point in the system. * Removes dead code from thread.cpp. * Moves the implementation of resetting a ThreadContext to the corresponding core's implementation. Other changes: * Fixed comments in arm interfaces. * Updated comments in thread.cpp * Removed confusing, useless, functions like MakeReady() and ChangeStatus() from thread.cpp. * Removed stack_size from Thread. In the CTR kernel, the thread's stack would be allocated before thread creation.
2015-02-02Kernel: Stop creating useless Handles during object creationYuri Kunde Schlesner
They're finally unnecessary, and will stop cluttering the application's handle table.
2015-02-02Kernel: Make WaitObjects share ownership of Threads waiting on themYuri Kunde Schlesner
During normal operation, a thread waiting on an WaitObject and the object hold mutual references to each other for the duration of the wait. If a process is forcefully terminated (The CTR kernel has a SVC to do this, TerminateProcess, though no equivalent exists for threads.) its threads would also be stopped and destroyed, leaving dangling pointers in the WaitObjects. The solution is to simply have the Thread remove itself from WaitObjects when it is stopped. The vector of Threads in WaitObject has also been changed to hold SharedPtrs, just in case. (Better to have a reference cycle than a crash.)
2015-02-02Explicitly instantiate constructors/destructors for Kernel objectsYuri Kunde Schlesner
This should speed up compile times a bit, as well as enable more liberal use of forward declarations. (Due to SharedPtr not trying to emit the destructor anymore.)
2015-02-02Mutex: Replace g_mutex_held_locks with a set inside ThreadYuri Kunde Schlesner
2015-02-02Kernel: Introduce unique Object ids for debuggingYuri Kunde Schlesner
2015-02-02Kernel: Use separate Handle tables for CoreTiming userdataYuri Kunde Schlesner
This is to support the removal of GetHandle soon
2015-02-02Thread: Modernize two functions that slipped through previous rebasesYuri Kunde Schlesner
2015-01-31arm: Clean up ARMul_StateLioncash
Remove unnecessary/unused struct variables.
2015-01-21Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup.bunnei
2015-01-21Thread: Use std::find in CheckWait_WaitObject.bunnei
2015-01-21Mutex: Cleanup and remove redundant code.bunnei
2015-01-21Kernel: Renamed some functions for clarity.bunnei
- ReleaseNextThread->WakeupNextThread - ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
2015-01-21Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void.bunnei
2015-01-21WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" ↵bunnei
pure virtual.
2015-01-21Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a ↵bunnei
WaitObject safely.
2015-01-21AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that ↵bunnei
made no sense.
2015-01-21Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks.bunnei
2015-01-21WaitSynchronizationN: Refactor to fix several bugsbunnei
- Separate wait checking from waiting the current thread - Resume thread when wait_all=true only if all objects are available at once - Set output to correct wait object index when there are duplicate handles
2015-01-21Kernel: Separate WaitSynchronization into Wait and Acquire methods.bunnei
2015-01-21WaitSynchronizationN: Implement return valuesbunnei
2015-01-21Thread: Keep track of multiple wait objects.bunnei
2015-01-21Kernel: Added WaitObject and changed "waitable" objects inherit from it.bunnei
2015-01-11Merge pull request #466 from Subv/wakebunnei
Thread: Prevent waking a thread multiple times.
2015-01-11Thread: Prevent waking a thread multiple times.Subv
If a thread was woken up by something, cancel the wakeup timeout.
2015-01-09Kernel: Start using boost::intrusive_ptr for lifetime managementYuri Kunde Schlesner
2015-01-09Thread: Fix nullptr access in a logging functionYuri Kunde Schlesner
2015-01-09Thread: Rename thread_queue => thread_listYuri Kunde Schlesner
2015-01-09Thread: Reduce use of Handles and move some funcs to inside the class.Yuri Kunde Schlesner
2015-01-09Kernel: Move Thread's definition to the header fileYuri Kunde Schlesner
2015-01-09Move ThreadContext to core/core.h and deal with the falloutYuri Kunde Schlesner
2015-01-08SVC: Fixed SleepThread.Subv
It will now properly wait the specified number of nanoseconds and then wake up the thread.
2015-01-07Threads: Use a dummy idle thread when no other are ready.Subv
This thread will not actually execute instructions, it will only advance the timing/events and try to yield immediately to the next ready thread, if there aren't any ready threads then it will be rescheduled and start its job again.
2015-01-07Common: Clean up ThreadQueueListYuri Kunde Schlesner
Replace all the C-style complicated buffer management with a std::deque. In addition to making the code easier to understand it also adds support for non-POD IdTypes. Also clean the rest of the code to follow our code style.
2014-12-28Kernel: New handle managerYuri Kunde Schlesner
This handle manager more closely mirrors the behaviour of the CTR-OS one. In addition object ref-counts and support for DuplicateHandle have been added. Note that support for DuplicateHandle is still experimental, since parts of the kernel still use Handles internally, which will likely cause troubles if two different handles to the same object are used to e.g. wait on a synchronization primitive.
2014-12-28Kernel: Replace GetStaticHandleType by HANDLE_TYPE constantsYuri Kunde Schlesner
2014-12-28Rename ObjectPool to HandleTableYuri Kunde Schlesner
2014-12-21Merge pull request #291 from purpasmart96/licensebunnei
License change
2014-12-20License changepurpasmart96
2014-12-20Thread: Wait current thread on svc_SleepThreadbunnei
- Removed unused VBLANK sleep mode - Added error log for bad context switch - Renamed VerifyWait to CheckWaitType to be more clear
2014-12-20Kernel: Implement support for current thread pseudo-handleYuri Kunde Schlesner
This boots a few (mostly Nintendo 1st party) games further.
2014-12-13Convert old logging calls to new logging macrosYuri Kunde Schlesner
2014-12-10Merge pull request #256 from Subv/mutexbunnei
Kernel/Mutex: Properly lock the mutex when a thread enters it
2014-12-08Thread: Fixed to wait on address when in arbitration.bunnei