mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-20 09:55:07 -04:00
fatal: refactor for R_TRY
This commit is contained in:
parent
f9bf8923b1
commit
31fde233e1
30 changed files with 226 additions and 285 deletions
|
@ -13,7 +13,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <switch.h>
|
||||
#include "fatal_types.hpp"
|
||||
#include "fatal_event_manager.hpp"
|
||||
|
@ -35,12 +35,12 @@ FatalEventManager::FatalEventManager() {
|
|||
|
||||
Result FatalEventManager::GetEvent(Handle *out) {
|
||||
std::scoped_lock<HosMutex> lk{this->lock};
|
||||
|
||||
|
||||
/* Only allow GetEvent to succeed NumFatalEvents times. */
|
||||
if (this->events_gotten >= FatalEventManager::NumFatalEvents) {
|
||||
return ResultFatalTooManyEvents;
|
||||
}
|
||||
|
||||
|
||||
*out = this->events[this->events_gotten++].revent;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue