mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
cf686ffc95
commit
86587f284d
|
@ -1785,8 +1785,6 @@ begin
|
||||||
|
|
||||||
thread_unlock(td);
|
thread_unlock(td);
|
||||||
|
|
||||||
md_test_alert;
|
|
||||||
|
|
||||||
if ((flags and TDF_ALRMPEND)<>0) then
|
if ((flags and TDF_ALRMPEND)<>0) then
|
||||||
begin
|
begin
|
||||||
PROC_LOCK;
|
PROC_LOCK;
|
||||||
|
|
|
@ -131,6 +131,9 @@ begin
|
||||||
Result:=msleep_td(slptick);
|
Result:=msleep_td(slptick);
|
||||||
|
|
||||||
thread_lock(td);
|
thread_lock(td);
|
||||||
|
|
||||||
|
//reset thread wakeup queue after lock
|
||||||
|
md_reset_wakeup;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function setrunnable(td:p_kthread):Integer;
|
function setrunnable(td:p_kthread):Integer;
|
||||||
|
|
|
@ -262,7 +262,8 @@ begin
|
||||||
Assert(td^.td_sleepqueue=nil);
|
Assert(td^.td_sleepqueue=nil);
|
||||||
Assert(wchan<>nil);
|
Assert(wchan<>nil);
|
||||||
|
|
||||||
td^.td_slptick:=time;
|
//Hack: callout_reset_curcpu(@td^.td_slpcallout, timo, sleepq_timeout, td);
|
||||||
|
td^.td_slptick :=time;
|
||||||
td^.td_slpcallout:=@sleepq_timeout;
|
td^.td_slpcallout:=@sleepq_timeout;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -440,6 +441,8 @@ begin
|
||||||
|
|
||||||
r:=mi_switch(SW_VOL or SWT_SLEEPQ);
|
r:=mi_switch(SW_VOL or SWT_SLEEPQ);
|
||||||
|
|
||||||
|
//Hack: call sleepq_timeout on timeout
|
||||||
|
if (r=ETIMEDOUT) then
|
||||||
if (td^.td_slpcallout=Pointer(@sleepq_timeout)) then
|
if (td^.td_slpcallout=Pointer(@sleepq_timeout)) then
|
||||||
begin
|
begin
|
||||||
sleepq_timeout(td);
|
sleepq_timeout(td);
|
||||||
|
@ -450,7 +453,10 @@ begin
|
||||||
mtx_lock(td^.tdq_lock);
|
mtx_lock(td^.tdq_lock);
|
||||||
thread_lock_set(td,@td^.tdq_lock);
|
thread_lock_set(td,@td^.tdq_lock);
|
||||||
|
|
||||||
Assert(TD_IS_RUNNING(td),'running but not TDS_RUNNING');
|
if not TD_IS_RUNNING(td) then
|
||||||
|
begin
|
||||||
|
Assert(false,'running but not TDS_RUNNING');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -474,6 +480,11 @@ begin
|
||||||
if ((td^.td_flags and TDF_TIMOFAIL)<>0) then
|
if ((td^.td_flags and TDF_TIMOFAIL)<>0) then
|
||||||
begin
|
begin
|
||||||
td^.td_flags:=td^.td_flags and (not TDF_TIMOFAIL);
|
td^.td_flags:=td^.td_flags and (not TDF_TIMOFAIL);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
//Hack: callout_stop(@td^.td_slpcallout)
|
||||||
|
td^.td_slptick :=0;
|
||||||
|
td^.td_slpcallout:=nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -105,8 +105,6 @@ procedure _set_ucontext(dst:PCONTEXT;src:p_ucontext_t);
|
||||||
|
|
||||||
function md_get_fpcontext(td:p_kthread;mcp:p_mcontext_t;xstate:Pointer):Integer;
|
function md_get_fpcontext(td:p_kthread;mcp:p_mcontext_t;xstate:Pointer):Integer;
|
||||||
|
|
||||||
procedure md_test_alert;
|
|
||||||
|
|
||||||
procedure ipi_sigreturn;
|
procedure ipi_sigreturn;
|
||||||
function ipi_send_cpu(td:p_kthread):Integer;
|
function ipi_send_cpu(td:p_kthread):Integer;
|
||||||
|
|
||||||
|
@ -600,11 +598,6 @@ begin
|
||||||
//xmm,ymm
|
//xmm,ymm
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure md_test_alert;
|
|
||||||
begin
|
|
||||||
NtTestAlert();
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure switch_to_jit(td:p_kthread); external;
|
procedure switch_to_jit(td:p_kthread); external;
|
||||||
|
|
||||||
procedure ipi_sigreturn;
|
procedure ipi_sigreturn;
|
||||||
|
|
|
@ -12,6 +12,7 @@ uses
|
||||||
|
|
||||||
function msleep_td(timo:Int64):Integer;
|
function msleep_td(timo:Int64):Integer;
|
||||||
function wakeup_td(td:p_kthread):Integer;
|
function wakeup_td(td:p_kthread):Integer;
|
||||||
|
procedure md_reset_wakeup;
|
||||||
procedure md_yield;
|
procedure md_yield;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
@ -69,6 +70,11 @@ begin
|
||||||
Result:=ntw2px(NtQueueApcThread(td^.td_handle,@_apc_null,nil,nil,0));
|
Result:=ntw2px(NtQueueApcThread(td^.td_handle,@_apc_null,nil,nil,0));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure md_reset_wakeup;
|
||||||
|
begin
|
||||||
|
NtTestAlert();
|
||||||
|
end;
|
||||||
|
|
||||||
procedure md_yield;
|
procedure md_yield;
|
||||||
begin
|
begin
|
||||||
NtYieldExecution;
|
NtYieldExecution;
|
||||||
|
|
Loading…
Reference in New Issue