mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-12-23 03:11:49 +01:00
Minor improvements
This commit is contained in:
parent
5a9aac7d22
commit
bfb52bbeb5
@ -9,7 +9,7 @@
|
||||
#include "ftp.h"
|
||||
#include "net.h"
|
||||
|
||||
BackgroundThread * BackgroundThread::instance = NULL;
|
||||
BackgroundThread * BackgroundThread::instance = nullptr;
|
||||
|
||||
BackgroundThread::BackgroundThread(): BackgroundThreadWrapper(BackgroundThread::getPriority()) {
|
||||
DEBUG_FUNCTION_LINE("Create new Server");
|
||||
@ -18,7 +18,7 @@ BackgroundThread::BackgroundThread(): BackgroundThreadWrapper(BackgroundThread::
|
||||
DCFlushRange(&(this->serverSocket), 4);
|
||||
mutex.unlock();
|
||||
DEBUG_FUNCTION_LINE("handle %d", this->serverSocket);
|
||||
resumeThread();
|
||||
CThread::resumeThread();
|
||||
}
|
||||
|
||||
BackgroundThread::~BackgroundThread() {
|
||||
@ -47,7 +47,7 @@ BOOL BackgroundThread::whileLoop() {
|
||||
DCFlushRange(&(this->serverSocket), 4);
|
||||
mutex.unlock();
|
||||
}
|
||||
OSSleepTicks(OSMillisecondsToTicks(16));
|
||||
}
|
||||
OSSleepTicks(OSMillisecondsToTicks(16));
|
||||
return true;
|
||||
}
|
||||
|
@ -60,6 +60,8 @@ ON_APPLICATION_START(args) {
|
||||
|
||||
ACGetAssignedAddress(&hostIpAddress);
|
||||
|
||||
nn::ac::Finalize();
|
||||
|
||||
WHBLogUdpInit();
|
||||
|
||||
//!*******************************************************************
|
||||
@ -67,7 +69,7 @@ ON_APPLICATION_START(args) {
|
||||
//!*******************************************************************
|
||||
|
||||
DEBUG_FUNCTION_LINE("IOSUHAX_Open");
|
||||
int res = IOSUHAX_Open(NULL);
|
||||
int res = IOSUHAX_Open(nullptr);
|
||||
if(res < 0) {
|
||||
DEBUG_FUNCTION_LINE("IOSUHAX_open failed");
|
||||
VirtualMountDevice("fs:/");
|
||||
|
@ -1,10 +1,8 @@
|
||||
#include "BackgroundThreadWrapper.hpp"
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <coreinit/cache.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
BackgroundThreadWrapper::BackgroundThreadWrapper(int32_t priority): CThread(CThread::eAttributeAffCore2, priority, 0x100000) {
|
||||
}
|
||||
@ -16,7 +14,7 @@ BackgroundThreadWrapper::~BackgroundThreadWrapper() {
|
||||
}
|
||||
|
||||
void BackgroundThreadWrapper::executeThread() {
|
||||
while (1) {
|
||||
while (true) {
|
||||
if(exitThread) {
|
||||
DEBUG_FUNCTION_LINE("We want to exit");
|
||||
break;
|
||||
|
@ -6,19 +6,19 @@
|
||||
|
||||
class BackgroundThreadWrapper: public CThread {
|
||||
public:
|
||||
BackgroundThreadWrapper(int32_t priority);
|
||||
virtual ~BackgroundThreadWrapper();
|
||||
explicit BackgroundThreadWrapper(int32_t priority);
|
||||
~BackgroundThreadWrapper() override;
|
||||
protected:
|
||||
BOOL shouldExit() {
|
||||
[[nodiscard]] BOOL shouldExit() const {
|
||||
return (exitThread == 1);
|
||||
}
|
||||
|
||||
void setThreadPriority(int32_t priority) {
|
||||
this->setThreadPriority(priority);
|
||||
void setThreadPriority(int32_t priority) override {
|
||||
CThread::setThreadPriority(priority);
|
||||
}
|
||||
std::recursive_mutex mutex;
|
||||
private:
|
||||
void executeThread();
|
||||
void executeThread() override;
|
||||
|
||||
/**
|
||||
Called when a connection has be accepted.
|
||||
|
Loading…
Reference in New Issue
Block a user