diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-11-22 17:10:07 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-11-22 17:10:07 +0000 |
commit | 4a395ad025e3f453faacc2b3a90f64ede10bef40 (patch) | |
tree | 5f38749ce4982afd4f23bc3b0e55533becce88c4 /amiga/schedule.c | |
parent | 4589cab4337d537c425cbab40452c69a2d7a3fd3 (diff) | |
download | netsurf-4a395ad025e3f453faacc2b3a90f64ede10bef40.tar.gz netsurf-4a395ad025e3f453faacc2b3a90f64ede10bef40.tar.bz2 |
Process scheduled event changes before incoming timer events.
This stops things being run that have just been deleted. However, may cause the next event to run early because we don't check the time.
Diffstat (limited to 'amiga/schedule.c')
-rwxr-xr-x | amiga/schedule.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/amiga/schedule.c b/amiga/schedule.c index eae5ae31a..d49db1bc4 100755 --- a/amiga/schedule.c +++ b/amiga/schedule.c @@ -432,16 +432,6 @@ static int32 ami_scheduler_process(STRPTR args, int32 length, APTR execbase) while(running) { signal = Wait(signalmask); - if(signal & timersig) { - while((timermsg = (struct TimerRequest *)GetMsg(timermsgport))) { - /* reply first, as we don't need the message contents and - * it crashes if we reply after schedule_run has executed. - */ - ReplyMsg((struct Message *)timermsg); - ami_scheduler_run(nsmsgport); - } - } - if(signal & schedulesig) { while((asmsg = (struct ami_schedule_message *)GetMsg(schedulermsgport))) { if(asmsg->msg.mn_Node.ln_Type == NT_REPLYMSG) { @@ -465,6 +455,17 @@ static int32 ami_scheduler_process(STRPTR args, int32 length, APTR execbase) } } } + + if(signal & timersig) { + while((timermsg = (struct TimerRequest *)GetMsg(timermsgport))) { + /* reply first, as we don't need the message contents and + * it crashes if we reply after schedule_run has executed. + */ + ReplyMsg((struct Message *)timermsg); + ami_scheduler_run(nsmsgport); /* \todo check timer event doesn't relate to + * something that's been deleted already */ + } + } } ami_schedule_free(timermsgport); |