mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-06-05 03:07:59 +00:00
Replace SmartCriticalSection with SmartLock
This commit is contained in:
parent
115557a551
commit
ac0c9505f3
@ -264,7 +264,7 @@ namespace Tasking
|
|||||||
|
|
||||||
void Task::Sleep(uint64_t Milliseconds)
|
void Task::Sleep(uint64_t Milliseconds)
|
||||||
{
|
{
|
||||||
SmartCriticalSection(TaskingLock);
|
SmartLock(TaskingLock);
|
||||||
TCB *thread = this->GetCurrentThread();
|
TCB *thread = this->GetCurrentThread();
|
||||||
thread->Status = TaskStatus::Sleeping;
|
thread->Status = TaskStatus::Sleeping;
|
||||||
if (thread->Parent->Threads.size() == 1)
|
if (thread->Parent->Threads.size() == 1)
|
||||||
@ -341,7 +341,7 @@ namespace Tasking
|
|||||||
TaskArchitecture Architecture,
|
TaskArchitecture Architecture,
|
||||||
TaskCompatibility Compatibility)
|
TaskCompatibility Compatibility)
|
||||||
{
|
{
|
||||||
SmartCriticalSection(TaskingLock);
|
SmartLock(TaskingLock);
|
||||||
TCB *Thread = new TCB;
|
TCB *Thread = new TCB;
|
||||||
if (Parent == nullptr)
|
if (Parent == nullptr)
|
||||||
{
|
{
|
||||||
@ -641,7 +641,7 @@ namespace Tasking
|
|||||||
TaskTrustLevel TrustLevel, void *Image,
|
TaskTrustLevel TrustLevel, void *Image,
|
||||||
bool DoNotCreatePageTable)
|
bool DoNotCreatePageTable)
|
||||||
{
|
{
|
||||||
SmartCriticalSection(TaskingLock);
|
SmartLock(TaskingLock);
|
||||||
PCB *Process = new PCB;
|
PCB *Process = new PCB;
|
||||||
Process->ID = this->NextPID++;
|
Process->ID = this->NextPID++;
|
||||||
strcpy(Process->Name, Name);
|
strcpy(Process->Name, Name);
|
||||||
@ -739,7 +739,7 @@ namespace Tasking
|
|||||||
|
|
||||||
Task::Task(const IP EntryPoint) : Interrupts::Handler(CPU::x86::IRQ16)
|
Task::Task(const IP EntryPoint) : Interrupts::Handler(CPU::x86::IRQ16)
|
||||||
{
|
{
|
||||||
SmartCriticalSection(TaskingLock);
|
SmartLock(TaskingLock);
|
||||||
#if defined(a64)
|
#if defined(a64)
|
||||||
// Map the IRQ16 to the first CPU.
|
// Map the IRQ16 to the first CPU.
|
||||||
((APIC::APIC *)Interrupts::apic[0])->RedirectIRQ(0, CPU::x86::IRQ16 - CPU::x86::IRQ0, 1);
|
((APIC::APIC *)Interrupts::apic[0])->RedirectIRQ(0, CPU::x86::IRQ16 - CPU::x86::IRQ0, 1);
|
||||||
@ -837,7 +837,7 @@ namespace Tasking
|
|||||||
Task::~Task()
|
Task::~Task()
|
||||||
{
|
{
|
||||||
debug("Destructor called");
|
debug("Destructor called");
|
||||||
SmartCriticalSection(TaskingLock);
|
SmartLock(TaskingLock);
|
||||||
trace("Stopping tasking");
|
trace("Stopping tasking");
|
||||||
foreach (PCB *Process in ListProcess)
|
foreach (PCB *Process in ListProcess)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user