aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/kernel/thread.cpp
Commit message (Collapse)AuthorAge
* Scheduler refactor Pt. 1Gravatar Kevin Hartman2015-02-09
| | | | | | | | | | | | | * 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.
* Kernel: Stop creating useless Handles during object creationGravatar Yuri Kunde Schlesner2015-02-02
| | | | | They're finally unnecessary, and will stop cluttering the application's handle table.
* Kernel: Make WaitObjects share ownership of Threads waiting on themGravatar Yuri Kunde Schlesner2015-02-02
| | | | | | | | | | | | | | | | 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.)
* Explicitly instantiate constructors/destructors for Kernel objectsGravatar Yuri Kunde Schlesner2015-02-02
| | | | | | 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.)
* Mutex: Replace g_mutex_held_locks with a set inside ThreadGravatar Yuri Kunde Schlesner2015-02-02
|
* Kernel: Introduce unique Object ids for debuggingGravatar Yuri Kunde Schlesner2015-02-02
|
* Kernel: Use separate Handle tables for CoreTiming userdataGravatar Yuri Kunde Schlesner2015-02-02
| | | | This is to support the removal of GetHandle soon
* Thread: Modernize two functions that slipped through previous rebasesGravatar Yuri Kunde Schlesner2015-02-02
|
* arm: Clean up ARMul_StateGravatar Lioncash2015-01-31
| | | | Remove unnecessary/unused struct variables.
* Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup.Gravatar bunnei2015-01-21
|
* Thread: Use std::find in CheckWait_WaitObject.Gravatar bunnei2015-01-21
|
* Mutex: Cleanup and remove redundant code.Gravatar bunnei2015-01-21
|
* Kernel: Renamed some functions for clarity.Gravatar bunnei2015-01-21
| | | | | - ReleaseNextThread->WakeupNextThread - ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
* Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void.Gravatar bunnei2015-01-21
|
* WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" ↵Gravatar bunnei2015-01-21
| | | | pure virtual.
* Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a ↵Gravatar bunnei2015-01-21
| | | | WaitObject safely.
* AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that ↵Gravatar bunnei2015-01-21
| | | | made no sense.
* Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks.Gravatar bunnei2015-01-21
|
* WaitSynchronizationN: Refactor to fix several bugsGravatar bunnei2015-01-21
| | | | | | - 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
* Kernel: Separate WaitSynchronization into Wait and Acquire methods.Gravatar bunnei2015-01-21
|
* WaitSynchronizationN: Implement return valuesGravatar bunnei2015-01-21
|
* Thread: Keep track of multiple wait objects.Gravatar bunnei2015-01-21
|
* Kernel: Added WaitObject and changed "waitable" objects inherit from it.Gravatar bunnei2015-01-21
|
* Merge pull request #466 from Subv/wakeGravatar bunnei2015-01-11
|\ | | | | Thread: Prevent waking a thread multiple times.
| * Thread: Prevent waking a thread multiple times.Gravatar Subv2015-01-11
| | | | | | | | If a thread was woken up by something, cancel the wakeup timeout.
* | Kernel: Start using boost::intrusive_ptr for lifetime managementGravatar Yuri Kunde Schlesner2015-01-09
|/
* Thread: Fix nullptr access in a logging functionGravatar Yuri Kunde Schlesner2015-01-09
|
* Thread: Rename thread_queue => thread_listGravatar Yuri Kunde Schlesner2015-01-09
|
* Thread: Reduce use of Handles and move some funcs to inside the class.Gravatar Yuri Kunde Schlesner2015-01-09
|
* Kernel: Move Thread's definition to the header fileGravatar Yuri Kunde Schlesner2015-01-09
|
* Move ThreadContext to core/core.h and deal with the falloutGravatar Yuri Kunde Schlesner2015-01-09
|
* SVC: Fixed SleepThread.Gravatar Subv2015-01-08
| | | | It will now properly wait the specified number of nanoseconds and then wake up the thread.
* Threads: Use a dummy idle thread when no other are ready.Gravatar Subv2015-01-07
| | | | 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.
* Common: Clean up ThreadQueueListGravatar Yuri Kunde Schlesner2015-01-07
| | | | | | | | 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.
* Kernel: New handle managerGravatar Yuri Kunde Schlesner2014-12-28
| | | | | | | | | | | 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.
* Kernel: Replace GetStaticHandleType by HANDLE_TYPE constantsGravatar Yuri Kunde Schlesner2014-12-28
|
* Rename ObjectPool to HandleTableGravatar Yuri Kunde Schlesner2014-12-28
|
* Merge pull request #291 from purpasmart96/licenseGravatar bunnei2014-12-21
|\ | | | | License change
| * License changeGravatar purpasmart962014-12-20
| |
* | Thread: Wait current thread on svc_SleepThreadGravatar bunnei2014-12-20
| | | | | | | | | | | | - Removed unused VBLANK sleep mode - Added error log for bad context switch - Renamed VerifyWait to CheckWaitType to be more clear
* | Kernel: Implement support for current thread pseudo-handleGravatar Yuri Kunde Schlesner2014-12-20
|/ | | | This boots a few (mostly Nintendo 1st party) games further.
* Convert old logging calls to new logging macrosGravatar Yuri Kunde Schlesner2014-12-13
|
* Merge pull request #256 from Subv/mutexGravatar bunnei2014-12-10
|\ | | | | Kernel/Mutex: Properly lock the mutex when a thread enters it
* | Thread: Fixed to wait on address when in arbitration.Gravatar bunnei2014-12-08
| |
| * Mutex: Release all held mutexes when a thread exits.Gravatar Subv2014-12-07
|/
* Threads: Remove a redundant function.Gravatar Subv2014-12-04
| | | | Use the next_thread_id variable directly.
* Threads: Implemented a sequential thread idGravatar Subv2014-12-04
|
* SVC: Implemented GetThreadId.Gravatar Subv2014-12-04
| | | | For now threads are using their Handle value as their Id, it should not really cause any problems because Handle values are unique in Citra, but it should be changed. I left a ToDo there because this is not correct behavior as per hardware.
* Thread: Check that thread is actually in "wait state" when verifying wait.Gravatar bunnei2014-11-26
|
* Use pointers instead of passing handles around in some functions.Gravatar Yuri Kunde Schlesner2014-11-24
|